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
fandecine
Frequent Visitor

Conditional formatting

Hi,

I have a measure Delta as follow:

Delta = SWITCH(
    TRUE(),
    [Hours_Submitted_TS] - [Hours_Forecast] > 0, "Charged more than expected",
    [Hours_Submitted_TS] - [Hours_Forecast] < 0, "Charged less than expected",
    [Hours_Submitted_TS] - [Hours_Forecast] = 0, "Charged as forecasted"
    )
 
I put this measure in a table and would like to change colors depending on the text.
Since this is not based on a field (also using 2 more measures9 , I don't see how to do it.
Thanks for your help.
LD
1 ACCEPTED SOLUTION
_AAndrade
Super User
Super User

Hi @fandecine,

 

You can use a measure to define the color like this:

Delta Color= SWITCH(
    TRUE(),
    [Delta ] = "Charged more than expected", "RED",
     [Delta ] = "Charged less than expected", "YELLOW",
    [Delta ] = "Charged as forecasted", "GREEN"
    )

Then go to Format Ribon and follow the path indicated by @ChiragGarg2512., like this:
_AAndrade_3-1713428024591.png

 

_AAndrade_2-1713427956587.png

 





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




View solution in original post

6 REPLIES 6
_AAndrade
Super User
Super User

Hi @fandecine,

 

You can use a measure to define the color like this:

Delta Color= SWITCH(
    TRUE(),
    [Delta ] = "Charged more than expected", "RED",
     [Delta ] = "Charged less than expected", "YELLOW",
    [Delta ] = "Charged as forecasted", "GREEN"
    )

Then go to Format Ribon and follow the path indicated by @ChiragGarg2512., like this:
_AAndrade_3-1713428024591.png

 

_AAndrade_2-1713427956587.png

 





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




@_AAndrade Thanks for the correction.

ChiragGarg2512
Super User
Super User

Go to Format Visual -> Cell Element -> Background Color -> Field[Format Style] -> Select the measure.

Hi,

Well, nothing happens.

I have

Format style: Field value

Apply To: Values only

What field: Delta

You need to choose What field: Delta Color (the new measure)





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Hi,

The formatting is working fine showing correct values either in red or green.

However, when I publish my report on the BI Server, all my values show as red (tables and cards)!

Any idea why? We have BI server Jan 2023.

Thx. 
LD

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.