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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
NicolasGarcia
New Member

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
v-huijiey-msft
Community Support
Community Support

Hi @NicolasGarcia ,

 

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
v-huijiey-msft
Community Support
Community Support

Hi @NicolasGarcia ,

 

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!

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

@NicolasGarcia , 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/...
https://amitchandak.medium.com/power-bi-where-is-the-conditional-formatting-option-in-new-format-pan...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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