cancel
Showing results 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

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]))

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
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.

Proud to be a Super User!

4 REPLIES 4
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.

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.

Proud to be a Super User!

Helper I

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)

Super User

Can you share the code you wrote?

Proud to be a Super User!

Announcements

#### 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.

#### Power BI Monthly Update - August 2024

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

#### Fabric Community Update - August 2024

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

Top Solution Authors
Top Kudoed Authors