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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
shaun-bi
New Member

Help declaring max value measure for a guage?

I have a single dataset that has table called "reservations", which is presented in a BI report as a simple table. In this table it has a column called "buildings". Each building has a maximum capacity number (not contained in the table) which is hard set and can be included in the measure (if that makes sense to).

 

I want a measure to count the rows for each building in the table i.e London so that when a slice is set in the report to filter the table by building, and to define a maximum value for the guage which is building specific.

 

We're just using a simple measure to count the rows displayed in the table today which is applied to the guage:

Measure1 = COUNTROWS(reservations)

1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hi, 

According to your description, I can clearly understand your requirement, you want to create a gauge chart to display the comparison between your maximum capacity number and current capacity number, right? I think you can achieve your requirement by creating some measures like this:

This is the test data I created based on your description:

vrobertqmsft_0-1635755494638.png

 

maximum capacity number =

MAX('reservations'[capacity number])
Current capacity numbers = COUNT(reservations[buildings])
Max = maxX(ALL(reservations),[capacity number])
Min = 0

 

And you can create a gauge chart and place it like this, then you can get what you want, like this:

vrobertqmsft_1-1635755494642.png

 

You can download my test pbix file below

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

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

4 REPLIES 4
v-robertq-msft
Community Support
Community Support

Hi, 

According to your description, I can clearly understand your requirement, you want to create a gauge chart to display the comparison between your maximum capacity number and current capacity number, right? I think you can achieve your requirement by creating some measures like this:

This is the test data I created based on your description:

vrobertqmsft_0-1635755494638.png

 

maximum capacity number =

MAX('reservations'[capacity number])
Current capacity numbers = COUNT(reservations[buildings])
Max = maxX(ALL(reservations),[capacity number])
Min = 0

 

And you can create a gauge chart and place it like this, then you can get what you want, like this:

vrobertqmsft_1-1635755494642.png

 

You can download my test pbix file below

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

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

Fowmy
Super User
Super User

@shaun-bi 

Do you need a new measure to get the capacity number based on the currently filtered building ? How about a new measure?

 

MaxValue = SELECTEDVALUE (reservations[capacity number]) , 0 )

 

or

MaxValue = MAX(reservations[capacity number])



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Greg_Deckler
Super User
Super User

@shaun-bi Maybe:

Max Measure = 
  VAR __Building = MAX('Table'[Building])
RETURN
  SWITCH(__Building,
    "Building1",44,
    "Building2",33,
    ...
  )

@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks, this sets the maximums perfectly.

 

How do I combine that with the countrows to compare the table data to the maximum value. As right now, the gauge is just displaying the maximum values.

 

I've used BI for 2 hours only so sorry for the newbie questions!

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors