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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
lhdp
Helper I
Helper I

Max of a month by year with daily data

Hello,

 

Simple need : I have daily data : Date & Value for 2 years.

I just need a table with Year and the month in the year where I have the maximum of sum of daily value.

 

I tried with this command which send the sum of each month :

EVALUATE
SUMMARIZE(sum_max, sum_max[Date].[Année], sum_max[Date].[Mois], "Sum", SUM(sum_max[Value]))

sum_max.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

And I want to obtain : 

2021 / 1693 (Max monthly sum of 2021)

2022 / 1785 (Max monthly sum of 2022)

with the year in inner context.

 

Howe I can do that ? Nested Summarize ? Add a column with the monthly value for the current year for each line and average to calculate the result ? Thanks in advance. Laurent 

 

 

 

 

1 ACCEPTED SOLUTION
jgeddes
Super User
Super User

You should be able to wrap your summarize statement with MAXX.

MAXX(
SUMMARIZE(sum_max, sum_max[Date].[Année]sum_max[Date].[Mois]"Sum"SUM(sum_max[Value])),
[Sum],
)

This will give the max value for the table created with the summarize function. Adding the Annee column to your visual will provide the desired context.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

4 REPLIES 4
lhdp
Helper I
Helper I

Sorry, It's finally ok. I've created as a column and not as a measure. It's ok with measure. I close it and I thank you.

jgeddes
Super User
Super User

You should be able to wrap your summarize statement with MAXX.

MAXX(
SUMMARIZE(sum_max, sum_max[Date].[Année]sum_max[Date].[Mois]"Sum"SUM(sum_max[Value])),
[Sum],
)

This will give the max value for the table created with the summarize function. Adding the Annee column to your visual will provide the desired context.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Thank you. I take a step but I meet this problem : the value in not contextualized with the year in the inner filter. The value is the same for the 2 years (1785 : the grand max) instead of beiing different (1693 & 1785)

 

sum_max.PNG

Can you share the code you wrote?




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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