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

Conditionnal formating with 2 Calculation group

Hello All,

I'm trying to apply a conditionnal formating to a table where I have 2 Calculation Group:

- One with my measures 

- One with Time variation (actual, p-1, and var %)

 

I want to apply a conditionnal formating to my column "VAR %" and only this one. I want the variation to be red if it's negative and green if positive (and an other of my problem is that i want the reverse for the measure "Cost per Sales" ie: red if positve, green if negative). 

 

In order to do that i've created the measure Conditional Color like that:

CONDITIONAL COLOR = if(SELECTEDVALUE('TIME VAR'[Variation]) IN {"ACTUAL","P-1"},BLANK(),1)
 
It works fine when I just put 1 measure alone, but when I add my Calculation Group with All my Measures it ignore totally my conditional formating. 
 
Do you know how to solve that?
 
I've try to replicate my data issue in a specific file pbi , i join it here:  https://we.tl/t-Wp4SMWbxuS 

 

Thank you for your help

 

 

2 REPLIES 2
v-jiewu-msft
Community Support
Community Support

Hi @claxxx ,

If I understand correctly, the issue is that you want to apply a conditional formatting to make the positive is red and the negative is green. Please try the following methods and check if they can solve your problem:

1.Create a measure. Enter the following DAX formula.

 

Measure = 
var _persales = SELECTEDVALUE('MESURE GROUP'[Mesure])
var _salesvar = SELECTEDVALUE('TIME VAR'[Variation])
RETURN
    IF (
        _salesvar IN {"ACTUAL", "P-1"},
        BLANK(),
        IF (
            _persales = "Cost per Sales" && _salesvar = "VAR",
            BLANK(),
            1
        )
    )

 

2.Select the INIT KPI values and choose the conditional formatting.

vjiewumsft_0-1704936958388.png

3.Select the measure and set the Rules.

vjiewumsft_1-1704936974368.png

 

 

4.The result is shown below.

vjiewumsft_2-1704936983865.png

 

Best Regards,

Wisdom Wu

 

 

 

Thank you for your answer. 

My point was principally to apply a conditionnal formating only to the "VAR %" column. 

So for all measures the column "Actual" and "P-1" should maintain without any color, and VAR % have to be the only column with a conditionnal color. 

In your result I see that the 3 column "Actual", "P-1", and "VAR %" have the conditional format but I just want VAR % to have it. Do you have a solution to do that? 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.