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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
Anonymous
Not applicable

Tableau to power BI Color coding

IF SUM([True Audit Days]) <ATTR([MIN DAYS]) THEN 'red' ELSEIF SUM([True  Days]) >ATTR([MAX DAYS]) THEN 'red' ELSE 'green' END

how to change this color coding format into power BI DAX ?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , to understand attr, need some sample data. As of now assumed you have measures for Min and Max days 

 

Create a new measure and use that in conditional formatting using filed value option

 

Switch( true() ,
SUM([True Audit Days]) < ([MIN DAYS]) , "red" ,
SUM([True Days]) > ([MAX DAYS]) ,"red" ,
"green"
)

 

refer if needed

Tableau ATTR: https://www.youtube.com/watch?v=6mXMPX7S8oU&list=PLPaNVDMhUXGYzjFASXjdY7GNoFxvlkR54&index=21

 

How to do conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4

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

View solution in original post

2 REPLIES 2
ALLUREAN
Solution Sage
Solution Sage

Hi, @Anonymous 
Create a measure like:
ColorMeasure = SWITCH(TRUE(),

SUM([True Audit Days]) <ATTR([MIN DAYS]), 1, --see remarks below
SUM([True  Days]) >ATTR([MAX DAYS]), 1,

2) 

 

not sure what ATTR is doing, but you can replace by SELECTEDVALUE ... SELECTEDVALUE('Table'[SomeColumn],"*")

https://community.powerbi.com/t5/Desktop/How-do-we-add-ATTR-function-of-Tableau-to-Power-BI/td-p/1914910

 

Then go to condition formatting and if is background for example, use by Rule and search for this measure. Rules will be:

If = 1, select some red color,

If = 2, select some green color

 

Did I answer your question? Please Like and Mark my post as a solution if it solves your issue. Thanks.

Appreciate your Kudos !!!

https://allure-analytics.com/




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




amitchandak
Super User
Super User

@Anonymous , to understand attr, need some sample data. As of now assumed you have measures for Min and Max days 

 

Create a new measure and use that in conditional formatting using filed value option

 

Switch( true() ,
SUM([True Audit Days]) < ([MIN DAYS]) , "red" ,
SUM([True Days]) > ([MAX DAYS]) ,"red" ,
"green"
)

 

refer if needed

Tableau ATTR: https://www.youtube.com/watch?v=6mXMPX7S8oU&list=PLPaNVDMhUXGYzjFASXjdY7GNoFxvlkR54&index=21

 

How to do conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.