Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

DAX Measure help

Hi,   I am trying to get all measures shown based on selection, I had trouble to show what I needed as the slicer or filter exclude all other records that I need. What I want to do: If a select s...
  • v-zhenbw-msft's avatar
    6 years ago

    Hi Anonymous ,

     

    We can use two measures to meet your requirement. One calculates the average of region, another calculates the average of state.

     

    average of region = 
    CALCULATE (
        AVERAGE ( 'Table'[Profit] ),
         ALLSELECTED ( 'Table' ), ALL ( 'Table'[Shop] ) ,
        'Table'[Region] IN DISTINCT ( 'Table'[Region] ),
        'Table'[State] IN DISTINCT ( 'Table'[State] )
    )

     

    average of State = 
    CALCULATE (
        AVERAGE ( 'Table'[Profit] ),
        ALLSELECTED ( 'Table' ), ALL ( 'Table'[Shop] ) ,
        'Table'[State] IN DISTINCT ( 'Table'[State] )
    )

     

    The result like this,

     

     

    BTW, pbix as attached.

     

    Best regards,

     

    Community Support Team _ zhenbw

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