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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

changing background color with condition

Hello,

i am working on a table for some time now and i can't figure how to do it if its possible i am quite new to power bi so i don't even know if its possible.

Here is my problem i want to change the color of certain rows between green and red depending on the fact that the value for sap_full_release is the same for the other rows of the tripplet 

NicolasGarcia_0-1709734751272.png

as you can see for each sap_component there is three rows and i want to compare the value of sap release for each row if one of the sap release is different i want the three rows background to be red and if not i want it to be green.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

A DAX measure needs to be created to determine if the SAP release of each component is consistent across all environments. Returns false if consistent and true if inconsistent.

ReleaseDiffernce = IF(CALCULATE(DISTINCTCOUNT('sap'[sap_full_release]), ALLEXCEPT('sap', 'sap'[sap_component])) > 1, "true", "false")

 

Set the format of the condition based on the different values of ReleaseDiffernce.

vhuijieymsft_0-1709799451346.png

vhuijieymsft_1-1709799451349.png

 

 

The page result is shown below:

vhuijieymsft_0-1709799554560.png

 

If you have any other questions please feel free to contact me.

 

The pbix file is attached.

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

 

A DAX measure needs to be created to determine if the SAP release of each component is consistent across all environments. Returns false if consistent and true if inconsistent.

ReleaseDiffernce = IF(CALCULATE(DISTINCTCOUNT('sap'[sap_full_release]), ALLEXCEPT('sap', 'sap'[sap_component])) > 1, "true", "false")

 

Set the format of the condition based on the different values of ReleaseDiffernce.

vhuijieymsft_0-1709799451346.png

vhuijieymsft_1-1709799451349.png

 

 

The page result is shown below:

vhuijieymsft_0-1709799554560.png

 

If you have any other questions please feel free to contact me.

 

The pbix file is attached.

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

Anonymous
Not applicable

Hi,

Thanks that helped a lot, i struggled with the condition since i am not fammiliar with DAX, it works now !

amitchandak
Super User
Super User

@Anonymous , you can use measure to do that using field value option.

 

switch(true() ,
max(Table[Release]) = "736SP4" , "Green",
max(Table[Release]) = "735SP4" , "Grey"
max(Table[Release]) = "734SP4" , "Red"
)

 

If needed you can use hexcode with # sign

 

How to do conditional formatting by measure and apply it on pie?
https://www.youtube.com/watch?v=RqBb5eBf_I4&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
https://community.powerbi.com/t5/Community-Blog/Power-BI-Conditional-formatting-the-Pie-Visual/ba-p/1682539
https://amitchandak.medium.com/power-bi-where-is-the-conditional-formatting-option-in-new-format-pane-66e0afcb15f3

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.