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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.