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
manjum
Employee
Employee

MAX of calculated Measure across Filtered Value

Hi DAX experts,

 

We have below table, Region is filter and  Avg Yearly Sales is measure, (so it can return Avg Yearly Sales), if we select filter say, US+UK, then 

Avg: 150

Max : 300,

But, what i want to calculate is Max(Avg), 200.  But, what I am getting is 300. How can i do that?

 

 

Region     |      Avg Yearly Sales | Avg Quarterly Sales

US            |       100                   |    [100,200,50,50] 

UK            |        200                  |    [ 100, 200, 300, 200]

AUS          |        300                  |    [ 100, 200, 400, 500]

CAN          |        400                  |   [ 200, 400, 600, 400] 

 

more details:

I tried this formula:

CalculatedPeakToken = CALCULATE(MAX(Table[Avg Yearly Sales]), FILTER(ALLSELECTED(Table), Table[Region] IN ALLSELECTED( Table[Region])))

 

where 

Avg Yearly Sales is calculated from measure. = 

AllTokenUtilRate =
DIVIDE(
    SUM('Table'[Avg Quarterly Sales]),
      )

 

This always results: MAX across all quaterly sales.

 

Thanks,

Manju

1 REPLY 1
Jihwan_Kim
Super User
Super User

Hi,

I do not know how your data model looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

I hope the below can provide some ideas on how to create a solution for your datamodel.

 

Jihwan_Kim_0-1679810064345.png

 

Jihwan_Kim_1-1679810237811.png

 

Avg yearly sales: = 
AVERAGEX(Sales, Sales[Sales])

 

Max sales: = 
MAXX( DISTINCT(Region[Region]), [Avg yearly sales:])

 

 

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.


Go to My LinkedIn Page


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