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

How to Calculate The Max Value in Quarter

Hi EVERYONE 

 

I have An Indicator that is Calculated Monthly, I need a Measure that calculates it quarterly based on the Max of each Quarter. EXample 

 

my indicator calculate the values monthly , like this table, what i want , to return Max value in each Quarter for each company ,  The variable is the numerator divided by the denominator, i have date table with Month column, and quarter column and year. 

 
then I will find the Rank for each company based on the max value in each quarter. 

 

COMP NameOCTNOVDEC
SDDF1200$130008000$
SSD20000$18000%30000$
FDE90000$13000$25000$
 
 
1 ACCEPTED SOLUTION
Whitewater100
Solution Sage
Solution Sage

Hello:

This measure will give you the monthly max for each quarter. You can plug your measure in where I have [Total Sales],then set your visual to quarterly.

Qtr Month MAX = Calculate(Maxx(Values('Date'[Month]),[total sales]), Filter('Date','Date'[Month] <=Max('Date'[Month])))
Here's the visual described above. I hope this helps!
Whitewater100_0-1649511582017.png

 

 

View solution in original post

3 REPLIES 3
Whitewater100
Solution Sage
Solution Sage

Hello:

This measure will give you the monthly max for each quarter. You can plug your measure in where I have [Total Sales],then set your visual to quarterly.

Qtr Month MAX = Calculate(Maxx(Values('Date'[Month]),[total sales]), Filter('Date','Date'[Month] <=Max('Date'[Month])))
Here's the visual described above. I hope this helps!
Whitewater100_0-1649511582017.png

 

 

thanks!

can you explain what this part of dax mean?

 

Filter('Date','Date'[Month] <=Max('Date'[Month])))

Hi:

This part means (Filter('Date','Date'[Month]  or Filter(ALL('Date','Date'[Month]) or Filter(ALLSELECTED('Date','Date'[Month] ) that the engine will go through all the months in your visual. Using the ALLSELECTED version could be the best choice.

 

The second part (<=Max('Date'[Month])))  means look at all the months up to and including the last month(MAX Month)  in your visual.

 

Since youer visual is based on Quarters, it will look at the months reporting into each Quarter and provide the highest month in the Quarter.

 

Below is another pattern doing the same type of thing, using SUMMARIZE to review all the months involved.

 

 

 

HighestMonthValue =

MAXX (

    SUMMARIZE (

        TableName,

        TableName[Month],

        "Total Sales", SUM ( SalesTableName[Sales] )

    ),

    [Total Sales]

)

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.

Top Solution Authors