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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
admin11
Memorable Member
Memorable Member

How to make Rev go is good and Exp go up is bad ?

Hi All

i have Table which display Rev & Exp in one table .

I can make Rev go up display VARI % green 

but I cannot make Exp go up display VARI % Red

See image below 

https://www.dropbox.com/s/0069e5bwamsh93k/IMG_5663.PNG?dl=0

Paul

2 ACCEPTED SOLUTIONS
DataZoe
Microsoft Employee
Microsoft Employee

@admin11 I would try creating another measure to use for the conditional formatting:

 

CF for Table =

if(selectedvalue('Table'[ITEM])="Rev",[Vari NP %],
if(selectedvalue('Table'[ITEM])="COGS",[Vari NP %]*-1,

blank()))

 

then in the conditional formatting use this one as your range with the diverging option on, making the center 0.

 

DataZoe_0-1614788226585.png

 

 

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

View solution in original post

v-alq-msft
Community Support
Community Support

Hi, @admin11 

 

Based on your descritpion, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

b1.png

 

Measure1:

Measure1 = SUM('Table'[Value1])

 

Measure2:

Measure2 = SUM('Table'[Value2])

 

Vari %:

Vari % = 
DIVIDE(
    [Measure2]-[Measure1],
    [Measure1]
)

 

You may create a measure as below.

Color Control = 
var val = 
SWITCH(
    SELECTEDVALUE('Table'[Item]),
    "Rev",[Measure2]-[Measure1],
    "Exp",[Measure1]-[Measure2]
)
return 
IF(
    val>0,
    "green",
    IF(
        val<0,
        "red"
    )
)

 

Then you need to conditionally format 'Vari %' based on 'Color Control'.

b2.png

 

Result:

b3.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-alq-msft
Community Support
Community Support

Hi, @admin11 

 

Based on your descritpion, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

b1.png

 

Measure1:

Measure1 = SUM('Table'[Value1])

 

Measure2:

Measure2 = SUM('Table'[Value2])

 

Vari %:

Vari % = 
DIVIDE(
    [Measure2]-[Measure1],
    [Measure1]
)

 

You may create a measure as below.

Color Control = 
var val = 
SWITCH(
    SELECTEDVALUE('Table'[Item]),
    "Rev",[Measure2]-[Measure1],
    "Exp",[Measure1]-[Measure2]
)
return 
IF(
    val>0,
    "green",
    IF(
        val<0,
        "red"
    )
)

 

Then you need to conditionally format 'Vari %' based on 'Color Control'.

b2.png

 

Result:

b3.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-alq-msft 

Thank you very much

DataZoe
Microsoft Employee
Microsoft Employee

@admin11 I would try creating another measure to use for the conditional formatting:

 

CF for Table =

if(selectedvalue('Table'[ITEM])="Rev",[Vari NP %],
if(selectedvalue('Table'[ITEM])="COGS",[Vari NP %]*-1,

blank()))

 

then in the conditional formatting use this one as your range with the diverging option on, making the center 0.

 

DataZoe_0-1614788226585.png

 

 

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

PhilipTreacy
Super User
Super User

@admin11 

Hi Paul,

Can you link to your PBIX please.

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.