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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
o59393
Post Prodigy
Post Prodigy

Calculate month with highest sales

Hi all

 

How can I return in a dax measure the month whose got the highest volume in any month?

 

In this case the highest volume is march, therefore the dax should return me March:

 

o59393_0-1685373095437.png

 

 

I already have calculated the maximum volume for march:

 

o59393_1-1685373095442.png

 

 

How could I get the march month with dax?

 

Thanks.

 

3 REPLIES 3
rsbin
Super User
Super User

@o59393 ,

You can try something like this:

MaxMonth = CALCULATE( MAX( Query1[Month 445] ),
                      FILTER( Query1, Query1[Rolling with % produced by plant] = 
                                             [Month Max demand] ))

I have tried my best to interpret your table and column names.  You may have to adjust the syntax if I have not got them correct.

Hope this helps.

Regards,

Hi  @rsbin 

 

I got this error:

 

o59393_0-1685385622742.png

 

To summarize what each means:

 

Query1[Period[Month 445]]]: is the column for Month
[Rolling with % produced by plant]: dax measure which basically is the sum of the KO volume column.
 
Hope that works.

Thanks.

@o59393 ,

Then please try this:

MaxMonth = CALCULATE( MAX( Query1[Month 445] ),
                      FILTER( Query1, Query1[KO Volume] = [Month Max demand] )) = 

  Regards,

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.