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
FL
Frequent Visitor

Max of Sum with multiple filters

Dear all,

I currently have an issue calculating the max of sum values per day. I would like to be able to create the red line on the graphic below taking into account the filters on the left.

The source table looks as follow - DateTime is every minute :

 
 

2021-01-11_10-39-15.jpg

 

FL_0-1610356886569.png

I have tried many formulas with SUMX, SUMMARIZE and FILTER but I cannot get the right result.

Ex : SumMax = SUMX(SUMMARIZE(Sheet1, Sheet1[Date],Sheet1[Type],Sheet1[Activité], "sum of Max", MAX(Sheet1[Nb])),[sum of Max])

But I get the following result - which is not what I am looking for : 

2021-01-11_10-29-53.jpg

 

Thank you in advance for your support

1 ACCEPTED SOLUTION

@FL , Not sure on , but this should first sum and then take max

 

measure =
calculate(maxX(values(Table[Datetime]),calculate(sum(Table[Nb]))), filter(allselected(Table), Table[date] = max(Table[date])))

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@FL , Try a measure like

 

measure =
calculate(max(Table[Nb]), allexcept(Table, Table[date]))

 

like

measure =
calculate(maxX(values(Table[Datetime]),[Nb]), allexcept(Table, Table[date]))

Thank you for the reply.

Unfortunately it does not work.

The first measure gives the following result:

FL_0-1610360034505.png

And the second one neither.

@FL , Please make sure date does have timestamp.

Try like

measure =
calculate(max(Table[Nb]), filter(allselected(Table), Table[date] = max(Table[date])))

It works when there is only one type and one activity selected :

2021-01-11_11-45-16.jpg

When I have more than one it goes wrong (it gives the maximum of one type/activitie) - it does not sum the activities below :

2021-01-11_11-47-31.jpg

@FL , Not sure on , but this should first sum and then take max

 

measure =
calculate(maxX(values(Table[Datetime]),calculate(sum(Table[Nb]))), filter(allselected(Table), Table[date] = max(Table[date])))

Thank you :

FL_0-1610365653701.png

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.