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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Measure for max of a group where the total is the sum of the unique max value for each group

I have this data set with some weekly data.

For the alllocated FFE  the value for each week is repeated for a given ID

I want a measure that shows me the sum value for each week, but the total for the same measure should only be the sum of the distinct values across all the weeks for each ID.

 

measure.PNG

So the value for week 201902 would be 400 without the ID in the table as two IDs has values for week 2

And the total should be=400 (220+180) as it should be the total for each ID's distinct value

 

The formula I have right now is:

 

IF(HASONEFILTER('Allocation Info'[Allocation YearWeek]);
SUMX(FILTER('Allocation Info';'Allocation Info'[R/I]=0);'Allocation Info'[FFE_Src]);
SUMX(VALUES('Allocation Info'[Allocation YearWeek]);CALCULATE(MAX('Allocation Info'[FFE_Src]);FILTER('Allocation Info';'Allocation Info'[R/I]=0)))
)
 
 But this part isn't really working:
SUMX(VALUES('Allocation Info'[Allocation YearWeek]);CALCULATE(MAX('Allocation Info'[FFE_Src]);FILTER('Allocation Info';'Allocation Info'[R/I]=0)))
 
As I am getting the sum of all the records...
This measure should also work without the ID present in the table (so just the weeks and the measure)
It seems like the IF(HASONEFILTER('Allocation Info'[Allocation YearWeek]); part is not really working
1 REPLY 1
Anonymous
Not applicable

Turns out the solution was alot more simple:

 

MAXX(VALUES('Allocation Info'[Allocation YearWeek]); [FFE])
Where [FFE] is just a notmal SUM of 'Allocation Info'[FFE_Src]

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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