Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
groffia
Frequent Visitor

Filter for multiple values using a measure _ DAX Expression Help

I'm having a hard time figuring out what is wrong with my calculation other than its hideousness... 

 

MEASURE:  Stop Time Per Unit:=[Total Stop Time]/[Total Machines]

 

Now I need to add up all the process groups that fall under/contribute to that stop time:

 

STPU Overall:=CALCULATE([Stop Time Per Unit],DimID[Cause Group]="",DimID[Cause Group]="Unknown",DimID[Cause Group]="Supply Chain", DimID[Cause Group]="Design",DimID[Cause Group]="Engineering",etc, etc, etc, for the other 11 cause groups.)

 

Is there a better more efficient way of doing this?  I guess I should also mention that when I add it up like this... it is: = BLANK

 

Thanks DAX experts

1 ACCEPTED SOLUTION
v-jiascu-msft
Employee
Employee

Hi @groffia,

 

If you have to list the values explicitly, you can try it out like this:

STPU Overall:=
CALCULATE (
    [Stop Time Per Unit],
    DimID[Cause Group]
        IN { BLANK (), "Unknown", "Supply Chain", "Design", "Engineering", "etc" }
)

If the measure can read the values from  a column, you can try it like this:

a =
CALCULATE (
    [Stop Time Per Unit],
    DimID[Cause Group] IN VALUES ( 'table1'[column] )
)

Note: table1 could be created by formula or by hand.

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-jiascu-msft
Employee
Employee

Hi @groffia,

 

If you have to list the values explicitly, you can try it out like this:

STPU Overall:=
CALCULATE (
    [Stop Time Per Unit],
    DimID[Cause Group]
        IN { BLANK (), "Unknown", "Supply Chain", "Design", "Engineering", "etc" }
)

If the measure can read the values from  a column, you can try it like this:

a =
CALCULATE (
    [Stop Time Per Unit],
    DimID[Cause Group] IN VALUES ( 'table1'[column] )
)

Note: table1 could be created by formula or by hand.

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 Hi Dale  @v-jiascu-msft, what if I want to use the values from that other table and do some calculation like below , its not working as I have written here ... please let me know if you need me to explain my scenario more? 

a =
CALCULATE (
    [Stop Time Per Unit] * values('table1[column2]),
    DimID[Cause Group] IN VALUES ( 'table1'[column] )
)

 

I knew there was a simpler way... your solution worked flawlessly.  Thank you for your help!

 

-Steve

groffia
Frequent Visitor

Yes, I realize it is a redundancy... but unfortunately necessary.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.