Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hey folks,
I am working on a code where I am making summarize table in which I am comparing the performance 'X' days before and 'X' days after the date of installation. It is working fine. Now I want to X days value from the user and store in to a variable so User can see the before and after according to their needs. I created paramater called Vardays but when I am storing the value of parameter in a variable called daysbeforeafter;it is not working but when I give a number to that variable then its working
Does anyone has any idea How I can achieve this? Thanks
You can create a separate measure for user input variable and use it to troubleshoot as well as pass in final measure to see what's actually being passed.
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
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.
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
How did you display the paramater in slicer, the paramater will return blank if you set the slicer type to between or other types that contain multiple paramaters. the selectedvalue() only return single value when you selected only one value, you can set the paramater type to 'single value' or 'dropdown' and select only one value. you can refer to the following link to know more about the selectedvalue() function.
SELECTEDVALUE function - DAX | Microsoft Learn
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.
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
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
113 | |
109 | |
101 | |
39 | |
31 |