How to create measures for gauge visual

Hi all,

I am trying to create gauge charts. I am struggling with measures.
I need to compare specific locations to all of them.
If I choose specific location on my slicer, I need to see something like below:

Could anyone please guide me on how to achieve that, please?

Grateful as always,

Iwona

Hi @Iwona,

Give something like this a go. Create a measure for the MIN value
Min Value = 0

Create a measure for the actual value
Count of Emp ID = SUM( 'Sample'[Count of Employee ID] )

Create a measure for the MAX value

Total Count of Emp ID = 
CALCULATE( 
    [Count of Emp ID],
    REMOVEFILTERS( 'Sample'[Location] )
)

And place them in the visual

I hope this is helpful

1 Like

Hi @Melissa

Many thanks for your help but something is wrong with my file ( measures).

10.02.23 forum.pbix (41.9 KB)

Could you please help.

Iwona

Hi @Iwona,

It would have been helpful if you’d shared this earlier. You’ve added a filter to the filter pane. Update the MAX measure to take this into account:

Total Count of Emp ID = 
CALCULATE( 
    count('forum 10 02 2023'[Employee ID]),
    'forum 10 02 2023'[Location] IN { 1, 2, 4 }
)

In my sample dataset, all works fine but in my real PBI file whichever Location I choose, I am getting the full area marked in blue not only a fraction of it:
image

I have checked my measures twice and still didn’t figure out the reason :frowning: I have more than 6000 employees .

Iwona

Sorry about that, give this a go instead.

Total Count of Emp ID = 
VAR _AllLocation = FILTER( ALL( 'forum 10 02 2023'[Location] ), 'forum 10 02 2023'[Location] <> 3 )
RETURN

CALCULATE( 
    count('forum 10 02 2023'[Employee ID]),
    _AllLocation
)
1 Like

This gave me what I need.
image

Grateful as always for your entire expertise and help.
Iwona