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

Win a FREE 3 Day Ticket to FabCon Vienna. Apply now

Reply
50ryk
Regular Visitor

Field Conditional Formatting Table with multiple measures

I have a table that dispalys the sales numbers for each day of the week of different locations.

 

LOCATIONMONDAYTUESDAYWEDNESDAY
CALIFORNIA651802855
TEXAS625660786

 

Each sales number for a day is calculated by a Measure. I have a Measure for Monday, Tuesday, Wednesday, etc..

 

Each location has different sales targets, ie California's target sales number is 800 and Texas' sales target is 650. I have a table with the sales target for each location. The table has a one to many relationship with the sales table that has a cross-filter in both directions.

 

I would like to have conditional formatting on the sales numbers based if they achieved their target or not. I have created another measure with a switch function based on each day.

 

CONDITIONAL_FORMATTING = 

  VAR SALESTARGET = SELECTEDVALUE(SALESTARGET_TABLE[TARGET])

  RETURN

  SWITCH(

      TRUE(),

      [MONDAY] >= SALESTARGET, "GREEN",
      [MONDAY] < SALESTARGET, "RED"

)

 

That works for individual days but I would rather not have 7 separate conditional formatting measures for each day. I tried substituting SELECTEDMEASURE() for the actual measure but this does not work. Is there anyway I can accomplish this?

1 ACCEPTED SOLUTION
Alex_Sawdo
Resolver II
Resolver II

Instead of using a table for this data, it may be easier to use a matrix instead with a single measure rather than individual measures for each day and hand some of the filtering off to the visual level rather than the measure level. You would put the day of week in the column field and the location in the row field, then your measure in the values field. Then, you can implement conditional formatting on a single measure based on the SELECTEDVALUE of the row and column through the existing relationship. 

View solution in original post

2 REPLIES 2
Alex_Sawdo
Resolver II
Resolver II

Instead of using a table for this data, it may be easier to use a matrix instead with a single measure rather than individual measures for each day and hand some of the filtering off to the visual level rather than the measure level. You would put the day of week in the column field and the location in the row field, then your measure in the values field. Then, you can implement conditional formatting on a single measure based on the SELECTEDVALUE of the row and column through the existing relationship. 

wardy912
Solution Sage
Solution Sage

Hi @50ryk 

 

 You could use a calculation group. That will allow you to use one measure for all outcomes. You could use this instead of a separate measure for each day as well.

 

The following videos will give you what you need and more

 

Unlock the Full Potential of CALCULATION GROUPS in Power BI Desktop | Oct 2023 Power BI Update - You...

How to Conditional Format CALCULATION GROUP Columns in Power BI

Please give a thumbs up and mark as solved if this helps, thanks!


 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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