Forum Discussion
Store parameters values in a variable
Hey,
Appreciate your response
Here you can see the table and slicer and card which is showing the parameter value. Vardays is paramter column and Varday Value is measure which is: SELECTEDVALUE (VarDays[Vardays). Sum of test is a column which I made in summarize table and inserted the variable value in that where I am storing the VarDays value in variable called "Daysbeforeafter"
As we can see, parameters are working in canvas but in the backend code, parameters are not storing in the variable (As we can see the column of 'Sum of test' which is coming as blank) and I guess because of that blank, its not filtering anything
Hi Anonymous
The calculated table is the static table, it will not change by the paramater, so when you select one paramater, it will give the blank value, because the paramater is not existd in the table, you can consider to create a virtual table by using measure, then filter the related value from the virtual table,
e.g
dateinrange =
VAR daysbefore =
SELECTEDVALUE ( VarDays[VarDays] )
VAR _virtualtable =
the function you create the table
RETURN
MINX (
FILTER (
_virtualtable,
[Meterkey] IN VALUES ( Flow_Value_Daily_Consumption[Meterkey] )
),
[Sum of Test]
)
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous2 years agoNot applicable
Hey
Thanks its really great
But [Sum of test] is just for testing, I am filtering the table by passing parameter value in the variable if you can see the DAX above where VAR daysbeforafter=SELECTEDVALUE(VarDays[VarDays]),
Any number in that variable will go through dax and change the function accordingly, is that make sense?
I really appreciate your support
Thanks you