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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
lherbert501
Helper V
Helper V

Percentage Range

Hi there,

 

I have a simple measure for a gauge that gives me the correct colour, depending on the value.

 

Gauge = IF([sales] >= [SalesAverage], "#00A36C","#D64550")
 
gauge.PNG
 
However, as one is 71.2% percent and one is 71.1%, this isnt picking it up as equals to.
 
Is there a way around this, or to account for the rounding?
 
Thanks
 
Liam
 
 
 
1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @lherbert501 ,

According to your description, I create a sample.

vkalyjmsft_0-1661138835687.png

SalesAverage is a measure.

vkalyjmsft_1-1661138918462.png

Now, you can tweak the Gauge measure like this:

 

Gauge =
IF (
    INT ( MAX ( 'Table'[Sales] ) ) >= INT ( [SalesAverage] ),
    "#00A36C",
    "#D64550"
)

 

Get the result.

vkalyjmsft_0-1661146287521.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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

3 REPLIES 3
v-yanjiang-msft
Community Support
Community Support

Hi @lherbert501 ,

According to your description, I create a sample.

vkalyjmsft_0-1661138835687.png

SalesAverage is a measure.

vkalyjmsft_1-1661138918462.png

Now, you can tweak the Gauge measure like this:

 

Gauge =
IF (
    INT ( MAX ( 'Table'[Sales] ) ) >= INT ( [SalesAverage] ),
    "#00A36C",
    "#D64550"
)

 

Get the result.

vkalyjmsft_0-1661146287521.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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

Thankyou  @v-yanjiang-msft and @amitchandak  🙂

amitchandak
Super User
Super User

@lherbert501 , Make sure both measures are 1 or two decimal places and not whole numbers

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.