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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
abpgupta
Continued Contributor
Continued Contributor

Visual calculation : Conditional Formatting

Hi All

 

Can we enable conditional color formatting using Visual Calculations done (example in a matrix)?  

 

Please let me know if there is way.

 

Thanks for inputs

 

7 REPLIES 7
Poojara_D12
Super User
Super User

Hi @abpgupta @Lajouac 

No, conditional color formatting does not work with Visual Calculations in Power BI because these calculations are done at the visualization layer and are not part of the data model. Power BI’s conditional formatting rules require a measure or field from the data model, but Visual Calculations only exist within the report UI and cannot be referenced for formatting. As a workaround, you can create a measure in the data model that replicates the Visual Calculation logic and use it for formatting. Another approach is to define a separate measure specifically for conditional formatting using DAX, which assigns numerical values mapped to colors. If the calculation is row-level, you can consider using a calculated column instead. Since Visual Calculations are a relatively new feature, Microsoft may enhance them in future updates to support conditional formatting directly.

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos"

Kind Regards,
Poojara - Proud to be a Super User
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS

Thanks Poojara 🙂
It does not solve my problem, but it answers my question.
I am 100% based on a live connexion model, I do not want to go in Direct Query mode, so I cannot create new measures.

Since I cannot modify the model, I am relying only on visual calculations to add new "measures" in my reports.
I guess I will do without formatting for now.

 

Thanks !

Lajouac
Frequent Visitor

Thanks @lbendlin !

My visual calculation is

 

Class = SWITCH(
    TRUE(),
    [Running sum (%)] > 0.95, "C",
    [Running sum (%)] > 0.8, "B",
    "A"
)

 

 

I would like the background of A to be green, the background of B to be yellow and the background of C to be red.
How can I achieve that with FORMAT ?

Would it be something like this?

 

Class = SWITCH(
    TRUE(),
    [Running sum (%)] > 0.95, FORMAT("C","red"),
    [Running sum (%)] > 0.8, FORMAT("B","yellow"),
    FORMAT("A","green")
)

 



Hi everyone!

Our wish has come true!!!

 

Check out the February 2025 update blog post!

 

https://powerbi.microsoft.com/en-us/blog/power-bi-february-2025-feature-summary/

 

Can't wait to try it out!

 

Have a great weekend!

Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.

Lajouac
Frequent Visitor

Hi guys,

I am looking for the same solution here.

I have a table visual with a visual calculation column.
I would like to change the background color in this column according to each cell's value.
However, visual calc do not appear in the conditional formatting options 😞

Any idea how we can do that?

 

Thanks a lot,

 

Christian

lbendlin
Super User
Super User

You need to include the FORMAT as part of your visual calculation.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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