Forum Discussion

groffia's avatar
groffia
Helper I
8 years ago
Solved

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

  • 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

5 Replies

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Microsoft 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

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