Forum Discussion

akkitek's avatar
akkitek
Icon for Helper III rankHelper III
5 years ago
Solved

Creating a measure which returns the sum only when a specific value is selected in the slicer

Hey Everyone, 
Hope you're well. I am trying to create a measure which returns the sum of "count" only when I select a specifc value in the slicer.
For example:
I am trying to create a measure which will return the sum of "count" column only when Apple is selected. If any other value is selected it should return 0. Any help is appreciated. 
Thanks!

 

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    akkitek Measure = IF(SELECTEDVALUE('Slicer'[Fruits])="Apple",SUM('Table'[Count]),0)

    • akkitek's avatar
      akkitek
      Icon for Helper III rankHelper III

      Thanks! This worked perfectly!