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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.