Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Hierarchy Summation

When I select a County I want to to return all sales for the associated State. I'm currently using:

 
CALCULATE([Sales] , ALL(dimLoc[County], dimLoc[City]))
 
However this only works if I've 1) filtered by State or 2) contain the measure in a table that already has State.
 
Is there a way to force that hierarchy in DAX so if an end user selects County but not State they'll see the proper sum?
  • Hi Anonymous ,

     

    I think here we should use ALLSELETED function to work on it instead of ALL. If it doesn't meet your requirement, kindly share your sample data and excepted result to me. Please upload your files to One Drive and share the link here.

     

     

2 Replies

  • v-frfei-msft's avatar
    v-frfei-msft
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    I think here we should use ALLSELETED function to work on it instead of ALL. If it doesn't meet your requirement, kindly share your sample data and excepted result to me. Please upload your files to One Drive and share the link here.

     

     

    • v-frfei-msft's avatar
      v-frfei-msft
      Icon for Community Support rankCommunity Support

      Hi Anonymous ,

       

      Has your issue been solved? If so, kindly mark my answer as a solution to close the case. If any other question, feel free to let me know please.