Forum Discussion
What-if Parameter With Variable End Value
This works as a calculated table for me:
Parameter =
VAR X = SUM ( 'table'[Column] )
RETURN
GENERATESERIES (0, X, 1 )
However, the X variable (and hence the Parameter table) will not be affected by any slicers or filters. Calculated tables cannot be responsive to filters (unless they are just temporary tables used within a measure) since they are only calculated once per time the data is loaded or refreshed.
I see now what my problem was. I have a date filter for the complete dashboard, so it is making the sum of all the dates instead for the one applied. Do you think there is a workaround for that?
Thank you so much for the response! It was very insightfull!
- AlexisOlson4 years ago
Super User
Since the parameter is a calculated table, it cannot be responsive to your date filters.
There may be another way to ultimately achieve your actual end goal that you're creating this parameter for, but I don't have enough context to make any specific suggestions.
- Pablinho4 years ago
Helper I
I thought I could find a workaround but nothing so far. What I have is a lot of appended queries. Each table has a date column so I have a big appended table with almost the same values repeating but with a set of diferent dates. For example:
ID1 DATE1 ETC
ID2 DATE1 ETC
ID3 DATE1 ETC
ID4 DATE1 ETC
ID1 DATE2 ETC
ID2 DATE2 ETC
ID3 DATE2 ETC
ID4 DATE2 ETC
I have a slicer to filter by date so that only the information for that day is presented. I also have a gauge that shows a percentage and it changes based on the values that each date has. With a What-if parameter I am able to add a slicer that modifies that gauge with a pre-set value. However I have that daily value. What I want to do is to automatically plug that value to the parameter, so that it changes based on the date.
Right now the parameter returns the sum of all the dates because the filter is not being applied.
I hope that gives more context. Thanks!
- AlexisOlson4 years ago
Super User
I'm not sure I fully understand the purpose of the parameter. Generally, a parameter is used to give control of some variable to the end user.
You can use measures to define min/max/target on a gauge visual and measures are responsive to filters. Is this sufficient or does the user need to control something manually (rather than relying on a calculation to do the work)?