# Need help with DAX measures

• ### Question

• Good evening forummembers!

I have 2 table with this columns:

1. Patients

•Pat_code

•name

•sname

•etc.

2. healing

•code_healing

•date_healing (dd/mm/yy)

•Pat_code

•nigth - type boolean - true means that healing was at nigth, false - in the daytime

So  i need to create measure which will be divide patients to 2 type: who had first healing at nigth and who had during the day.

My first step was: create such measure in table "Patient" - MinCodeHealing - =CALCULATE(min(healing[code_healing]))

So i don't know how to create measure wich will matches value of column "hight" into table "Patient"

I suppose that you understand my idea=)

Thursday, January 12, 2012 3:50 PM

• You can just use the filters in other arguments of calculate:

CALCULATE(min(healing[code_healing]), healing[hight] = True )

or

CALCULATE(min(healing[code_healing]), healing[hight] )

(I don't remember whether you can use a comparison over a boolean table)

Marco Russo http://www.powerpivotworkshop.com http://sqlblog.com/blogs/marco_russo
• Marked as answer by Friday, January 20, 2012 3:16 AM
Thursday, January 12, 2012 4:04 PM
• Use:

=RELATED(healing[night]))

as a calculated column in the Patients table.

HTH!

David Hager

• Marked as answer by Friday, January 20, 2012 3:16 AM
Thursday, January 12, 2012 8:38 PM

### All replies

• You can just use the filters in other arguments of calculate:

CALCULATE(min(healing[code_healing]), healing[hight] = True )

or

CALCULATE(min(healing[code_healing]), healing[hight] )

(I don't remember whether you can use a comparison over a boolean table)

Marco Russo http://www.powerpivotworkshop.com http://sqlblog.com/blogs/marco_russo
• Marked as answer by Friday, January 20, 2012 3:16 AM
Thursday, January 12, 2012 4:04 PM
• Use:

=RELATED(healing[night]))

as a calculated column in the Patients table.

HTH!

David Hager

• Marked as answer by Friday, January 20, 2012 3:16 AM
Thursday, January 12, 2012 8:38 PM