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
RMV
Helper V
Helper V

conditional formatting of 2 calculated columns

Hi,

is it possible to set conditional formatting based on other field value when the based field is a calculated column?

tried to do the setup, but i couldn't clicked on the calculated column.

 

 

condformat.png

2 ACCEPTED SOLUTIONS

Color formatting by Field value requires a color field in your data model. It can either be a existing field, or a calculated column or a calculated measure.

https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-formatting-by-f...

 

But in your case, you can use Conditional Formatting by Rules (instead of by Field). Check the latest feature released with June update.

https://powerbi.microsoft.com/en-us/blog/power-bi-desktop-june-2019-feature-summary/#containerColors

 

View solution in original post

MFelix
Super User
Super User

Hi @RMV ,

 

Is possible to set the colour based on a measure you need to have the measure return the colour code you need based on this type of format:

 

Measure =
SWITCH (
    TRUE ();
    SUM ( Table1[Target] ) = 1; "#F2C80F";
    SUM ( Table1[Target] ) = 4; "#5F6B6D";
    SUM ( Table1[Target] ) = 5; "#000000"
)

In my case I'm making the check of the column, but you can do a switch based on a value from another column or measure, and define each interval as shown.

 

 

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

6 REPLIES 6
MFelix
Super User
Super User

Hi @RMV ,

 

Is possible to set the colour based on a measure you need to have the measure return the colour code you need based on this type of format:

 

Measure =
SWITCH (
    TRUE ();
    SUM ( Table1[Target] ) = 1; "#F2C80F";
    SUM ( Table1[Target] ) = 4; "#5F6B6D";
    SUM ( Table1[Target] ) = 5; "#000000"
)

In my case I'm making the check of the column, but you can do a switch based on a value from another column or measure, and define each interval as shown.

 

 

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Thanks all for the guidance.

I kinda used a bit of this and that, considering the measured column I used limited the setup of the conditional formatting based on field.

I have to create a variance field and added it up to the table, and set the conditional formatting in this field, instead.

Anonymous
Not applicable

Hey @RMV 

You are pointing at a measure, not a calculated field.

Dont think it is alowed.

Cheers!
A

yea, it's a measure.

thanks for the correction.

 

too bad it's not allowed.

 

is there any possible workaround?

Anonymous
Not applicable

Depends on your case.

You may use a calculated column.

Thanks
A

Color formatting by Field value requires a color field in your data model. It can either be a existing field, or a calculated column or a calculated measure.

https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-formatting-by-f...

 

But in your case, you can use Conditional Formatting by Rules (instead of by Field). Check the latest feature released with June update.

https://powerbi.microsoft.com/en-us/blog/power-bi-desktop-june-2019-feature-summary/#containerColors

 

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.