Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
AKWills
Regular Visitor

Totaling Measures W/ Filters

Hello, 

I hace created a series of measures with the logic if the value ="A" then display, if it equals "B" then display 2, if it equals "C" then display 3. I then created an additional measure to total the 3 number measures, the total should be. When I create a card with the measure if I do not edit the interactions it shows up as "(Blank)" but if I do edit the inenteractions it will only display the value of whatever filter/interaction that remains. In the below case the "C" card. Is there a way to create a measure that is the sum/total of filtered measures but is not a filtered measure itself?

 

image.png

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @AKWills ,

 

I have created a sample for your reference.

 

Measure = SWITCH(TRUE(),MAX('Table'[Category]) = "A",1,MAX('Table'[Category])="B",2,MAX('Table'[Category])="C",3)
total = SUMX('Table',[Measure])

Capture.PNG

 

Pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

3 REPLIES 3
v-frfei-msft
Community Support
Community Support

Hi @AKWills ,

 

I have created a sample for your reference.

 

Measure = SWITCH(TRUE(),MAX('Table'[Category]) = "A",1,MAX('Table'[Category])="B",2,MAX('Table'[Category])="C",3)
total = SUMX('Table',[Measure])

Capture.PNG

 

Pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
amitchandak
Super User
Super User

@AKWills 

For 3 you can simply take count of the values. You might be using If to handle that. Grand total do not have A,B, C so you are getting null. Use isfiltered or hasonevalue and force count when there is not value

https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/

I want the measure to return 6. The sum of 1+2+3, not the count of the measures.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.