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

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.

Reply
mtrevisiol
Helper V
Helper V

Calculate sum of max values

Hi everyone,

I've got this table:

mtrevisiol_1-1636993022938.png

 

that contains, for each "MOId" and for each Item, the list of operations done (with their timestart and time stop) and the number of pieces produced. 

 

Then I've got a simple calendar table:

mtrevisiol_2-1636993053454.png

 

My intent is to create a calculated column in the Calendar table, that contains the sum of the maximum values of the column "Pcs produced" for each MOId, Item and date (intended as TimeStart[Date]).

The ideal result would be:

DateSum of Maximums
10/11/2021

2818,90

11/11/20212447,17

 

Here are the .csv and .pbix files: https://www.dropbox.com/s/l7u31huv1fp3a5d/SUM%20of%20MAX.zip?dl=0

 

Thank you so much.

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure whether I understood your question correctly, but please check the below picture and the attached pbix file.

It is for creating a new column.

Picture2.png

 

Sum of Maximums CC =
VAR currentdate = 'Calendar'[Date]
VAR filterbycurrentdate_table =
FILTER ( 'SUM of MAX', 'SUM of MAX'[TimeStart - dateonly] = currentdate )
VAR groupby_max =
GROUPBY (
filterbycurrentdate_table,
'SUM of MAX'[MOId],
'SUM of MAX'[Item],
"@maxvalue", MAXX ( CURRENTGROUP (), 'SUM of MAX'[Pcs produced] )
)
RETURN
SUMX ( groupby_max, [@maxvalue] )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

I am not sure whether I understood your question correctly, but please check the below picture and the attached pbix file.

It is for creating a new column.

Picture2.png

 

Sum of Maximums CC =
VAR currentdate = 'Calendar'[Date]
VAR filterbycurrentdate_table =
FILTER ( 'SUM of MAX', 'SUM of MAX'[TimeStart - dateonly] = currentdate )
VAR groupby_max =
GROUPBY (
filterbycurrentdate_table,
'SUM of MAX'[MOId],
'SUM of MAX'[Item],
"@maxvalue", MAXX ( CURRENTGROUP (), 'SUM of MAX'[Pcs produced] )
)
RETURN
SUMX ( groupby_max, [@maxvalue] )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

@Jihwan_Kim this is exactly what I was looking for. Many thanks!

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors