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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Uzi2019
Super User
Super User

Get the MAX of the measure based on filters applied

Hi Expert,

I have one calculated measure on which I want to calculate MAX of this measure with respect to the filter selected by users.

Input fields:

Measure Name = Profit Measure

Filters/Slicers available = Region, Week, Channel

Output:

Max of the Profit Measure based on values selected by users in those filters

 

I would really appreciate your help.

P.S. I tried with MAXX along with ALLSELECTED/REMOVEFILTERS/SUMMERIZE but nothing worked.

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
1 ACCEPTED SOLUTION
Tahreem24
Super User
Super User

@Uzi2019 You can also try this measur:

Measure = MAXX(ALLSELCTED(TableName),[Profit Measure])

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

View solution in original post

3 REPLIES 3
Tahreem24
Super User
Super User

@Uzi2019 You can also try this measur:

Measure = MAXX(ALLSELCTED(TableName),[Profit Measure])

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
amitchandak
Super User
Super User

@Uzi2019 , Seem like @johnt75 has replied before me. So consider that reply before checking this. In case that does not solve the purpose, then consider this

 

You need to have something like this

 

Switch( True(),

selectedvalue(Slicer[Slicer])  ="Region", maxx(values(Table[Region]), [Measure]) ,

selectedvalue(Slicer[Slicer])  ="Week", maxx(values(Table[Week]), [Measure]) ,

selectedvalue(Slicer[Channel])  ="Week", maxx(values(Table[Channel]), [Measure])

)

johnt75
Super User
Super User

It depends on which column or columns you want to group by. If you are only grouping by 1 column then you could use

Max profit =
MAXX ( VALUES ( 'Table'[Column] ), [Profit] )

If you are grouping by more than 1 column then use

Max Profit =
MAXX ( SUMMARIZE ( 'Table', 'Table'[Column 1], 'Table'[Column 2] ), [Profit] )

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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