Forum Discussion
Dynamically set min and max Values for gauge visuals
Hello !
I'm working on a Power BI report where I have several gauge visuals that display different performance metrics. For each gauge, I want to dynamically set the min and max values based on the actual value and the target value, which are measures. For example:
- For a gauge showing ActualSales along BudgetedSales as target value, the max value should be the max between ActualSales and BudgetedSales.
- For another gauge, in the page of the same report, showing ActualMargin along BudgetedMargin as target value, the max value should be the max between ActualMargin and BudgetedMargin
Of course, I could create one measure MaxSales and another one MaxMargin, and use them as minimum and maximum values of my gauge, but I should created it for each of my other measure.
I would prefer a solution that allows me to reuse the same logic across multiple gauge visuals without having to create separate measures for each pair of actual and target values.
I've heard that calculation groups might be one way to achieve this, but I have been unable to use them for resolving my issue. I am open to other methods as well.
I really struggle to structure my measures so that I can reuse them as much as I can. It is a bit frustrating as a developer, as I would simply use functions and constants with a more standard programming language.
Could someone guide me on how to set up this dynamic behavior in Power BI, for my use case and for other more general case ? Any help or suggestions would be greatly appreciated!
Thank you!
benjos23 Yeah, that's why I have to experiment. I honestly don't think it is possible. Calculation groups were never intended to be used this way and quite frankly really have very limited utility outside of one or two specific use cases.
3 Replies
- Greg_Deckler
Community Champion
benjos23 DAX generally isn't very good about this sort of thing. Calculation groups are the only thing that I can think of that might assist with this but would have to experiment.
- benjos23
Helper I
Greg_DecklerI've tried using them and I think I understand the main concept. However, while I've been able to use them in a matrix visual, I don't know what to do to use them in my gauge visuals. What should I drag and drop into the "maximum value" field of the gauge visual?
- Greg_Deckler
Community Champion
benjos23 Yeah, that's why I have to experiment. I honestly don't think it is possible. Calculation groups were never intended to be used this way and quite frankly really have very limited utility outside of one or two specific use cases.