Forum Discussion

lherbert501's avatar
lherbert501
Post Prodigy
4 years ago
Solved

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")
 
 
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
 
 
 
  • Hi lherbert501 ,

    According to your description, I create a sample.

    SalesAverage is a measure.

    Now, you can tweak the Gauge measure like this:

     

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

     

    Get the result.

    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.

3 Replies

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

  • Hi lherbert501 ,

    According to your description, I create a sample.

    SalesAverage is a measure.

    Now, you can tweak the Gauge measure like this:

     

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

     

    Get the result.

    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.