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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
joce1127
Frequent Visitor

Power BI colour formating

joce1127_0-1713616663543.png

RYG = IF (ISBLANK ( VALUES ('Dashboard'[Define]) ),"#FFFFFF",IF (VALUES ('Sort'[Plan/Actual]) = "Plan" && VALUES ('Dashboard'[Define]) < TODAY (),"#BEBEBE",IF (VALUES('Sort'[Plan/Actual]) = "Actual" && VALUES ('Dashboard'[Define]) < TODAY (),"#92D050","#FFFFFF")))

 

this Dax I wrote for Define colour formating. My Define column have plan and actual date, if plan and actual date past due at the same time plan date and actual date are same date, plan date will become grey colour; actual date will become green colour. Example, plan date is 31-Jan-2024 and actual date is 31-Jan-2024. I need help to 1 condition, if actual date different with plan date, plan date will remain grey colour, actual date become yellow colour. Example plan date is 31-Jan-2024, actual date is 24-Jan-2024. 

 

Can advise me the DAX?

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @joce1127 
Change the "values" function which returns the table to selectedvalue().
More information about the function :

https://learn.microsoft.com/en-us/dax/selectedvalue-function

 


you can take a look at my solution in the linked discussion with pbix with a similar scenario.

https://community.fabric.microsoft.com/t5/Desktop/Conditional-Color-Formatting-when-comparing-Date-C...

 If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

1 REPLY 1
Ritaf1983
Super User
Super User

Hi @joce1127 
Change the "values" function which returns the table to selectedvalue().
More information about the function :

https://learn.microsoft.com/en-us/dax/selectedvalue-function

 


you can take a look at my solution in the linked discussion with pbix with a similar scenario.

https://community.fabric.microsoft.com/t5/Desktop/Conditional-Color-Formatting-when-comparing-Date-C...

 If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.