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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello!
I'm having trouble to create a DAX measure where I need to sum only the values of the lines where the category is the max category of the month.
Below is the sample data:
The measures I created are these:
The values in the SumCategories and the MaxCategory for each month are ok, but the totals and the SumCategoriesYTD are terribly wrong. Anyone can help me with that?
Here are the expected values:
Thanks in advance.
Solved! Go to Solution.
Hi,
try this DAX
SumCategories_new =
Var tbl = SUMMARIZE(Tabelle4,Tabelle4[Date],"sumcategorie",[SumCategories])
RETURN sumx(tbl,[sumcategorie])
If you want MaxCategory without total try this:
MaxCategory = IF(HASONEFILTER(Tabelle4[Date]),MAX(Tabelle4[Category]),BLANK())
A good link: https://www.vahiddm.com/post/why-my-measure-returns-the-wrong-total
Proud to be a Super User!
Hi,
try this DAX
SumCategories_new =
Var tbl = SUMMARIZE(Tabelle4,Tabelle4[Date],"sumcategorie",[SumCategories])
RETURN sumx(tbl,[sumcategorie])
If you want MaxCategory without total try this:
MaxCategory = IF(HASONEFILTER(Tabelle4[Date]),MAX(Tabelle4[Category]),BLANK())
A good link: https://www.vahiddm.com/post/why-my-measure-returns-the-wrong-total
Proud to be a Super User!
Hi @Greg_Deckler, thanks for the contribution.
It helped me to better understand the problem but yet I can't figure out how to resolve it.
Anyone else?
@MarcoSilva 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
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 9 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 27 | |
| 22 | |
| 20 | |
| 17 | |
| 12 |