Forum Discussion
What-if Parameter With Variable End Value
Hi!
So, I created a New Parameter called "Parameter". It uses a GENERATESERIES(0,73,1). This allows me to have a slice that goes from 0 to 73 in increments of 1. However, I want to define the end value (73) as a variable from a table, let say X. So for example, if X =sum('table'[Column]), GENERATESERIES(0,X,1). It doesn't work. It makes sense that it does not work because there isn't a relationship between those tables, but I can't find a way to create one. Is there a workaround for this?
Thank you!
14 Replies
- AlexisOlson
Super User
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.
- Pablinho
Helper I
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!
- AlexisOlson
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.