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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
jaythakur32
New Member

How to highlight maximum and minimum values?

Hi,

I am new to PBI and find it difficult to highlight the maximum and minimum values row-wise using DAX in the visual (matrix table). I have rows as Product Names from the Product table, columns as Warehouse Name from the Sales Order table, and values as total revenue (which is a measure created on the Sales Order table).

 

I want to know the maximum and minimum revenue generated from which warehouse for each product.

 

Below are the screenshots of Visual and column names


Warehouse.png

 

Warehouse_2.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @jaythakur32 

 

Based on your needs, I have created the following table.

vjialongymsft_0-1708588723599.png

 

You can use the following dax to get the result you want.

Measure 2 = var _tab=SUMMARIZE(ALLSELECTED('Table (2)'[area]),'Table (2)'[area], "@sumvalue",CALCULATE(SUM('Table (2)'[value])))
var _max= maxx( _tab,[@sumvalue])
var _min= MINX(_tab,[@sumvalue])
var _area=SELECTEDVALUE('Table (2)'[area])
return  SWITCH(TRUE(),sum('Table (2)'[Value])=_max&&_area="a","grey", sum('Table (2)'[Value])=_max&&_area= "b","grey",sum('Table (2)'[Value])=_max&&_area="c","grey",sum('Table (2)'[Value])=_max&&_area="d","grey",sum('Table (2)'[Value])=_min&&_area="a","green", sum('Table (2)'[Value])=_min&&_area= "b","green",sum('Table (2)'[Value])=_min&&_area="c","green",sum('Table (2)'[Value])=_min&&_area="d","green")

 

vjialongymsft_1-1708588817437.png

 

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @jaythakur32 

 

Based on your needs, I have created the following table.

vjialongymsft_0-1708588723599.png

 

You can use the following dax to get the result you want.

Measure 2 = var _tab=SUMMARIZE(ALLSELECTED('Table (2)'[area]),'Table (2)'[area], "@sumvalue",CALCULATE(SUM('Table (2)'[value])))
var _max= maxx( _tab,[@sumvalue])
var _min= MINX(_tab,[@sumvalue])
var _area=SELECTEDVALUE('Table (2)'[area])
return  SWITCH(TRUE(),sum('Table (2)'[Value])=_max&&_area="a","grey", sum('Table (2)'[Value])=_max&&_area= "b","grey",sum('Table (2)'[Value])=_max&&_area="c","grey",sum('Table (2)'[Value])=_max&&_area="d","grey",sum('Table (2)'[Value])=_min&&_area="a","green", sum('Table (2)'[Value])=_min&&_area= "b","green",sum('Table (2)'[Value])=_min&&_area="c","green",sum('Table (2)'[Value])=_min&&_area="d","green")

 

vjialongymsft_1-1708588817437.png

 

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

That's pretty straightforward if your data is in the right format (as it seems to be).  You need to compare each value agains the min and max value that you get when you apply REMOVEFILTERS(...[Warehouse Code])

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.