Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Answer | RED Question | Customer | Month | Quarter |
1 | Apple in menu | 100335 | 005.2024 | 2 |
1 | Orange in menu | 101496 | 005.2024 | 2 |
0 | Apple in menu | 100335 | 006.2024 | 2 |
Hi,
Based on our understanding, you want the "Total" column to display a value of 1 if both subtotals (for "Apple in menu" and "Orange in menu") are greater than 0, and 0 or blank otherwise. Here's how you can achieve this:
First, ensure you have separate measures for each category, "Apple in menu" and "Orange in menu". For example:
AppleInMenu =CALCULATE( DISTINCTCOUNT(details[Customer]), 'details'[RED Question] = "Apple in menu", details[Answer] > 0)
OrangeInMenu =CALCULATE( DISTINCTCOUNT(details[Customer]), 'details'[RED Question] = "Orange in menu", details[Answer] > 0)
Now, create a new measure for the "Total" column. This measure will check if both "Apple in menu" and "Orange in menu" subtotals are greater than 0, and if so, return 1; otherwise, return 0 or blank.
TotalMenu =IF( [AppleInMenu] > 0 && [OrangeInMenu] > 0, 1, 0 // Or use BLANK() if you don't want to display 0)
In your Power BI table, include:
This will display 1 if both subtotals are greater than 0, and 0 (or blank) if either subtotal is 0.
To ensure rows where details[Answer] = 0 are excluded from the summary table, the measures already use details[Answer] > 0, so any rows with an Answer of 0 will be excluded from the calculation. Additionally, you can apply a report-level filter to hide rows where Answer = 0 in your visual.
If you prefer to show blanks instead of 0, modify the TotalMenu measure like this:
TotalMenu =IF( [AppleInMenu] > 0 && [OrangeInMenu] > 0, 1, BLANK())
This will show a blank cell when the condition isn't met, instead of displaying 0.
This should provide the desired behaviour in your table, with the correct totals based on the specified conditions.
Hope this helps.
Thanks!
@Monster1992 First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e
This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907
Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8
Thank you Greg.
I can't use function HASONEVALUE / HASONEFILTER, because I have subtotals. I don't know how can I separate subtotal and total in code. The subtotal result is correct. Total is empty. I want to base the total result on subtotals. I don't know how to do this.