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

Conditional format base on measure result

Hi,

 

I need to set conditional formatting base on measure result.

 

i'm using measure to get avarage, now i want to setup icon or color on avarage result as baseline.

 

Appriciate your support.

 

Thanks

3 REPLIES 3
Icey
Community Support
Community Support

Hi @mhdilyas ,

 

Please show us a concrete example and tell us the result you want. This way we can provide a more direct solution.

 

Reference: How to Get Your Question Answered Quickly.

 

 

 

Best Regards,

Icey

 

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

 

BA_Pete
Super User
Super User

Hi @mhdilyas ,

 

Here's a couple of DAX examples:

 

Format based on column value:

_empStatusFormat = 
SWITCH(
    TRUE(),
    //greens
    MAX(dimWorkTypes[empStatus]) = "Available", "#b1e59f",
    //ambers
    MAX(dimWorkTypes[empStatus]) = "Possible", "#fae9a0",
    //purples
    MAX(dimWorkTypes[empStatus]) = "Unavailable", "#dbc3d6",
    //reds
    MAX(dimWorkTypes[empStatus]) = "Unknown", "#f6a0a7"
)

 

Format based on measure value:

_ProfitRAG = 
SWITCH(
     TRUE()
     ,[_Profit] < 0.7, "#BE4A47"
     ,[_Profit] < 0.8, "#F2C80F",
     "#01B8AA"
)

 

Be careful with how you use this though. In my experience, I've found using this a lot on a page can seriously slow down load times, although YMMV.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




jdbuchanan71
Super User
Super User

@mhdilyas 

Take a look at this article.  It has a lot of good information on conditional formatting.

https://www.sqlshack.com/conditional-formatting-in-power-bi-2/

Helpful resources

Announcements
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.