cancel
Showing results for
Did you mean:
Microsoft

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

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.

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

Announcements

#### Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

#### Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

#### Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

#### Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors