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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Captain_Jack909
Frequent Visitor

Sumx for Max-value per Sub-category

Hello All

I am new towards Power BI , and I am struggling with getting a sumx for max-value per subcategory. really appreciate if someone can help me !

 

I have a table which contains dimensions : category , subcategory and FC round as below picture .

Captain_Jack909_0-1678134290304.png

What I would like to achive is to get the value per subcategory from the max FC round on category level, in this case the max FC round is 202302.
I tried the dax : 

SUMX(SUMMARIZEfcinput,fcinput[category],"MaxRound_FC_value",
CALCULATE(SUM(fcinput[sum]),FILTER(fcinput,fcinput[FC round]=MAX(fcinput[FC round])))),[MaxRound_FC_value])

But I got an incorrect result as below which the yellow record should not be there, since it belongs to FC round 202301.
however the Total aggregation is correct.

Captain_Jack909_1-1678134676897.png
Jack
thanks in advance!

 

3 REPLIES 3
RiemuRiku
Frequent Visitor

Hi!

Had similiar issue, ran into your post.
Solved it this way in my case, hope you can use it too!

 

CumulativeZoneWeight_WithScopeAndTotal = 
VAR subCategoryMax = 
SUMMARIZE(Z_KrussMain, //returns table
Z_KrussMain[ZoneNr], //GroupBy columns
"Weight",MAX(Z_KrussMain[CumulativeZoneWeight])) // Columns to create

RETURN
IF(ISINSCOPE(Z_KrussMain[ZoneNr]),
MAX(Z_KrussMain[CumulativeZoneWeight]), // in scope, sublevel data. -> showing sublevel data
SUMX(subCategoryMax,[Weight]) // Sum the previously generated table
)

 

 

 

olgad
Super User
Super User

Hi, 

olgad_0-1678144136960.png

 


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

Thanks a lot for the help, Syndicate.

in the my data table, actually there are different categories, I tried the formular its correct on each row but the total is not sumed up , it seems it only sumx by the max FC round from the whole table

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.