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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
ktt777
Helper V
Helper V

Conditional formating

Hi , 

 

How can i make a conditional formating that is more dynamic , based on target , not a fixed number

I would like to have the performance be red if it less than target when i filter for different country

https://1drv.ms/u/s!ApIDnMK2eKiFgQXmusmux50Amuqw?e=fJedro

 

thanks 

 

 

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@ktt777 

Write a formatting measure that compares the amounts and returns the color based on the result.

Formatting = 
VAR _compare = SUM ( formating[performance ] ) - SUM ( formating[Target ] )
RETURN 
SWITCH (
    TRUE(),
    _compare > 0, "Green",
    _compare < 0, "Red",
    "Grey")    

Then set the conditional formatting based on the measure:

jdbuchanan71_0-1593752430553.png

 

View solution in original post

3 REPLIES 3
jdbuchanan71
Super User
Super User

@ktt777 

Write a formatting measure that compares the amounts and returns the color based on the result.

Formatting = 
VAR _compare = SUM ( formating[performance ] ) - SUM ( formating[Target ] )
RETURN 
SWITCH (
    TRUE(),
    _compare > 0, "Green",
    _compare < 0, "Red",
    "Grey")    

Then set the conditional formatting based on the measure:

jdbuchanan71_0-1593752430553.png

 

AllisonKennedy
Community Champion
Community Champion

You just need to create a measure that does
[Actual]-[Target]

Then use that measure to apply your conditional formatting, Red if less than 0.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.