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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply

Gauge visual conditional formatting

Hi, I have a table with

 

1. 'target deadline' which is the overall financial year target i.e., 500 for the 4 quarters

2. 'Target' for each quarter i.e., 125 every quarter

3. 'Metric value' for each quarter that they report on i.e., 100 which means they did not meet the target of 125 this quarter

4. 'Variance threshold' which shows the value that will be amber (119 so anything between 119 and 124 will be amber colour)

4. 'RAG' to show if they met target or not (red, amber, green)

 

I want to show this on a gauge so it shows an overall gauge with the RAG through conditional formatting, but also when the filter 'quarter' is selected, this will also pick up the RAG for that quarter. 

 

daniellamoore29_0-1695821801238.png

 

daniellamoore29_1-1695821880911.png

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@daniellamoore29 Try this. PBIX is attached below signature.

Measure = 
    VAR __Target = SUM('Table'[Target])
    VAR __Metric = SUM('Table'[Metric Value])
    VAR __Variance = SUM('Table'[Variance Threshold])
    VAR __Result =
        SWITCH( TRUE(),
            __Metric < __Variance, "Red",
            __Metric < __Target, "Yellow",
            "Green"
        )
RETURN
    __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5

@Greg_Deckler I've managed to add the Meaure to the conditional formatting as I amended the data types in the backend, thank you. 

 

I still have one issue, some quarters show the correct colour i.e., green colour or red colour, however some quarters still show blue. How do I amend these colours also?

 

daniellamoore29_0-1696940879971.pngdaniellamoore29_1-1696940889878.png

 

@Greg_Deckler how can I add the measure to the field value conditional formatting please? I am unable to change the meausre to text data type, it doesn't give me the option which other forums have said resolves the issue?

@daniellamoore29 This is what I did in the PBIX file (below). Not sure what issue you are having. If you want to use hex codes, you need to make sure your measure returns those as text, like "#FF0000" I believe.

Greg_Deckler_0-1696360675768.png

Measure = 
    VAR __Target = SUM('Table'[Target])
    VAR __Metric = SUM('Table'[Metric Value])
    VAR __Variance = SUM('Table'[Variance Threshold])
    VAR __Result =
        SWITCH( TRUE(),
            __Metric < __Variance, "#FF0000",
            __Metric < __Target, "Yellow",
            "#00FF00"
        )
RETURN
    __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Community Champion
Community Champion

@daniellamoore29 Try this. PBIX is attached below signature.

Measure = 
    VAR __Target = SUM('Table'[Target])
    VAR __Metric = SUM('Table'[Metric Value])
    VAR __Variance = SUM('Table'[Variance Threshold])
    VAR __Result =
        SWITCH( TRUE(),
            __Metric < __Variance, "Red",
            __Metric < __Target, "Yellow",
            "Green"
        )
RETURN
    __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

daniellamoore29_0-1695894583953.png

I cant seem to select 'Measure 2' for colour conditional formatting.

 

Helpful resources

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

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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