Forum Discussion

andya_utah's avatar
andya_utah
New Member
1 year ago
Solved

Gauge losing target value upon filtering

I am using the gauge visual to measure progress towards a target. Same dataset - 2 gauges.

 

Fields are: Job Status, Grant 

First dispalys as expected: 87 jobs - target 147 (Job Status = "Complete") (Grant = "WAP Bill")

 

 

Next one displays the target if I do not filter on job status:

(Job Status = "ALL") (Grant = "Formula")

 

 

However - If I filter on Job Status for "Complete" - I lose the target

(Job Status = "Complete") (Grant = "Formula")

 

I have scrubbed the data and see no difference at all that should result in this. Any ideas? Happy to provide a pbix or dataset. I have spent hours attempting to resolve.

 

Thanks

 

 

 

 

 

 

 

 

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi andya_utah ,
    Thanks for posting in Microsoft Fabric Community.

    The issue might be related to Power BI's default gauge rendering. When the value and the target differ significantly, or if filters change context, the visual sometimes auto-scales the axis in a way that hides the target needle.

     

    Here’s how you can fix it:

    Create two simple measures:
    1.GaugeMin = 0
    2.GaugeMax = 200 // or a number just above your target

    If you prefer to avoid hardcoding GuageMax, here's an example of dynamic version that always adds 20% buffer to your target:

    GaugeMax =
    VAR _target =
    CALCULATE(
    SUM('Visualization Target'[Formula]),
    FILTER(ALL('Visualization Target'), 'Visualization Target'[Grant] = "Formula")
    )
    VAR _buffered = _target * 1.2
    RETURN
    CEILING(_buffered, 10) // Rounds up to nearest 10

     

    Then use these in the Guage visual:

    Value = your completed jobs count measure (e.g. Count(ClientID))

    Target = your Target measure

    Minimum value = GaugeMin

    Maximum value = GaugeMax

    This will force the gauge to show the needle consistently, even when filters are applied.

     

    I was able to reproduce the same behavior in my environment.

     

    Hope this helps. Please reach out for further assistance.
    If this post helps, then please consider to Accept it as the solution to help the other members find it more quickly and a kudos would be appreciated.

     

    Thank you.

5 Replies

  • Hi andya_utah ,

     

    What is the value you are using has your target? 

     

    It seems to me that the target calculation for that specific grant is not filled.

     

    Can you share a mockup file please.

    • andya_utah's avatar
      andya_utah
      New Member

      Thanks Miguel - 

       

      Here is the target table:

       

       

      Here is a snip of the main dataset:

       They are joined with a calendar table in the middle:

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi andya_utah ,
    Thanks for posting in Microsoft Fabric Community.

    The issue might be related to Power BI's default gauge rendering. When the value and the target differ significantly, or if filters change context, the visual sometimes auto-scales the axis in a way that hides the target needle.

     

    Here’s how you can fix it:

    Create two simple measures:
    1.GaugeMin = 0
    2.GaugeMax = 200 // or a number just above your target

    If you prefer to avoid hardcoding GuageMax, here's an example of dynamic version that always adds 20% buffer to your target:

    GaugeMax =
    VAR _target =
    CALCULATE(
    SUM('Visualization Target'[Formula]),
    FILTER(ALL('Visualization Target'), 'Visualization Target'[Grant] = "Formula")
    )
    VAR _buffered = _target * 1.2
    RETURN
    CEILING(_buffered, 10) // Rounds up to nearest 10

     

    Then use these in the Guage visual:

    Value = your completed jobs count measure (e.g. Count(ClientID))

    Target = your Target measure

    Minimum value = GaugeMin

    Maximum value = GaugeMax

    This will force the gauge to show the needle consistently, even when filters are applied.

     

    I was able to reproduce the same behavior in my environment.

     

    Hope this helps. Please reach out for further assistance.
    If this post helps, then please consider to Accept it as the solution to help the other members find it more quickly and a kudos would be appreciated.

     

    Thank you.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi andya_utah ,

      We wanted to follow up and check if the solutions provided addressed your needs. If so, kindly mark it as accepted solution to assist others. If you require further assistance, please don't hesitate to reach out.

      Thank you.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi andya_utah ,

    Just checking in to see if you query is resolved and if any responses were helpful. If so, kindly consider marking the helpful reply as 'Accepted Solution' to help others with similar queries. 

    Otherwise, feel free to reach out for further assistance.

    Thank you.