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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
mundy727
Frequent Visitor

Conditional Formatting with static and dynamic data

Hi Power BI Community,

 

Im currently working with 2 datasets and i have a relationship between the 2, based off of individual name. Ive outlined the tables which make up the columns shown in the table below.

 

Recruiter name: from dataset #1, display the recruiter name

Recruiter capacity: from dataset #2, displays the recruiter capacity #. This # is static and tied to the recruiter name. For instance, each recruiter has their own capacity #

Total Req Load: from dataset #1, displays the total amount of reqs recruiter is working on at a given time. This value can fluctuate, based on the data being pulled into the data source

 

What id like to be able to do, is apply conditional formatting to the table visual (example shown below) so that the total req load cell aligned to the recruiter name highlights red, to reflect that if the recruiter shown has a total req load that is >= their recruiter capacity (i.e., Jimmy, Billy, and Jane below total req load exceeds their capacity).

 

Ive attempted with the rule and value options with conditional formatting that exist, but could use some guidance on how I can achieve this. If there are any additional details i can share that can be helpful, please let me know.

 

Recruiter NameRecruiter CapacityTotal Req Load
John Doe1015
Jane Doe119
Billy Bob1818
Jimmy Smith1518

 

Appreciate any guidance here!

 

1 ACCEPTED SOLUTION
Irwan
Super User
Super User

hello @mundy727 

 

i dont know how you pulled Load and Capacity, so i am not sure what form Load and Capacity are (column or measure).

 

but here is one of many ways to do conditional formating. please check if this accomodate your need.

 

1. If Load and Capacity are column, create new measure with following DAX. you can change the color code based on your requirement.

Color Palette = 
var _Capacity = SELECTEDVALUE('Table'[Recruiter Capacity])
var _Load = SELECTEDVALUE('Table'[Total Req Load])
Return
IF(
    _Load>=_Capacity,
    "#FF0000"
)
2. Pick one or more columns you want to do conditional formating from that down-arrow (you need to do the same step for other column). then go to conditional formating, then choose what kind of formating you want (i used background in this case).
Irwan_1-1730253027566.png

3. choose Field Value, then select the created measure from before.

Irwan_2-1730253235442.png

4. here is the result

Irwan_3-1730253262639.png

 

if Load and Capacity are measure, then change the DAX into this and the rest are exactly the same.

Color Palette = 
IF(
    [Load]>=[Capacity],
    "#FF0000"
)

 

Hope this will help.

Thank you.

View solution in original post

4 REPLIES 4
Houston-ho
Advocate I
Advocate I

I believe you need another measure, say "overload" boolean to calculate whether load > capcity.

then add conditional formatting when "overload" is true, red, else, green.

Irwan
Super User
Super User

hello @mundy727 

 

i dont know how you pulled Load and Capacity, so i am not sure what form Load and Capacity are (column or measure).

 

but here is one of many ways to do conditional formating. please check if this accomodate your need.

 

1. If Load and Capacity are column, create new measure with following DAX. you can change the color code based on your requirement.

Color Palette = 
var _Capacity = SELECTEDVALUE('Table'[Recruiter Capacity])
var _Load = SELECTEDVALUE('Table'[Total Req Load])
Return
IF(
    _Load>=_Capacity,
    "#FF0000"
)
2. Pick one or more columns you want to do conditional formating from that down-arrow (you need to do the same step for other column). then go to conditional formating, then choose what kind of formating you want (i used background in this case).
Irwan_1-1730253027566.png

3. choose Field Value, then select the created measure from before.

Irwan_2-1730253235442.png

4. here is the result

Irwan_3-1730253262639.png

 

if Load and Capacity are measure, then change the DAX into this and the rest are exactly the same.

Color Palette = 
IF(
    [Load]>=[Capacity],
    "#FF0000"
)

 

Hope this will help.

Thank you.

Thanks @Irwan , that worked flawlessly! THank you!

hello @mundy727 

 

glad to be a help.


Thank you.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.