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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
bblackwell3
Helper II
Helper II

Conditionally Format Max Row Values and compare

Hey All. I have two tables, like below
1. 

bblackwell3_0-1721686573066.png


2. 

bblackwell3_1-1721686597774.png

 

I am trying to conditionally color the values, if( the Items = Admin and Budgeted in Table 1) matches the (Item = Admin and baseline budget value in Table 2). Then I want to be able to filter for the Leader. I was able to create the logic, using max, however this is looking at column level, where I need a row level. When filtered, I lose the color conditions in my table visual

Below is my intended result


bblackwell3_2-1721686998889.png

  

bblackwell3_3-1721687020433.png

 

Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @bblackwell3 

Adjust the measure "match or not":

Match or not = IF(LOOKUPVALUE('Table2'[Budgeted],'Table2'[Budgeted],SELECTEDVALUE('Table1'[Budgeted])),"match","not match")



color = 
VAR _max = CALCULATE(MAX('Table1'[Budgeted]),FILTER(ALL('Table1'),[Match or not] = "match"))

RETURN
SWITCH(TRUE(),SELECTEDVALUE('Table1'[Budgeted])=_max,"green")

 

 

Result:

vjialongymsft_0-1721800129517.png

 

 

Pbix file attached.

 

 

 

 

 

 

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

3 REPLIES 3
Anonymous
Not applicable

Hi @bblackwell3 

 

First, create a measure to determine if the items and budgeted in the two tables match:

Match or not = IF(LOOKUPVALUE('Table2'[Budgeted],'Table2'[Items],SELECTEDVALUE('Table1'[Items]),'Table2'[Budgeted],SELECTEDVALUE('Table1'[Budgeted])),"match","not match")

 

Then create a measure to apply conditional formatting to the filtered matching values

color = 
VAR _max = CALCULATE(MAX('Table1'[Budgeted]),FILTER(ALL('Table1'),[Match or not] = "match"))

RETURN
SWITCH(TRUE(),SELECTEDVALUE('Table1'[Budgeted])=_max,"green")

 

 

Result:

vjialongymsft_0-1721700862466.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.

This could be a possible solution. However, I made a mistake on my end. I actually do not have an Items column in Table 2. How would this alter the logic?

Anonymous
Not applicable

Hi @bblackwell3 

Adjust the measure "match or not":

Match or not = IF(LOOKUPVALUE('Table2'[Budgeted],'Table2'[Budgeted],SELECTEDVALUE('Table1'[Budgeted])),"match","not match")



color = 
VAR _max = CALCULATE(MAX('Table1'[Budgeted]),FILTER(ALL('Table1'),[Match or not] = "match"))

RETURN
SWITCH(TRUE(),SELECTEDVALUE('Table1'[Budgeted])=_max,"green")

 

 

Result:

vjialongymsft_0-1721800129517.png

 

 

Pbix file attached.

 

 

 

 

 

 

Best Regards,

Jayleny

 

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

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.