Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Calcuate DAX help

I have two measures 

Example:

One is calculate(sum(value), filter(Table,table.source="a")

Another measure is calculate (sum(value),filter( table.table.source="b")

 

these measures are displaying in tabluar report.

 

state - Measure 1 ,Measure2

 

Also ,at the same time . The user  asking a slicer ( tablea.date),that should required in the report which should filter only Measure2 values ,not measure1 value.

 

How to avoid slicer - filter values that should not pass to measure1 values? What is the best DAX for calucating the measure 1 ?

 

 

 

  • Hi Anonymous ,

     

    Using all will clear all context filtering conditions.

    Choosing to use all or allexcept depends on the results you expect.

    There is only one state where you can choose to use all.

    Measure = CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[source]="a"))

    There are several states that can choose to use allexcept

    Measure = CALCULATE(SUM('Table'[value]),FILTER(ALLEXCEPT('Table','Table'[state]),'Table'[source]="a"))

     

    Best Regards,
    Liang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.