Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi guys, I have a question has anybody an idea how to let users enter thresholds as a slicer. I know this has to be done by adding a variable but I dont know how to do that. I put the link to to the file. So if I have shipping dates and and categories and the users tells me they want to be able to set their own thresholds for how long a difference in shipping date and arriving date is accepted how do I go about that? So the user should be able to say it is ok if a delivery takes 30 days but more than is a problem or 20 days . So how can I set a variable x, y in power bi and let the user insert the number they want ? A second question is that I have to create a categorization afterwards that based on the threshold if there is a 10percent delay is should be called " Acceptable" or 50% delay of the threshold, then it should be " Over threshold" but how can I set up the percentage that is accepted based on the threshold? Maaaany thanks! https://github.com/userdata21/file/blob/master/variable_question.pbix
Solved! Go to Solution.
Hi @userdata
Create two what-if paramter as link i post above
create them using UI, then you will get formual below automcatically.
Threshold = GENERATESERIES(0, 50, 1)
Pencentage = GENERATESERIES(0, 1, 0.0010)
Create measures
Measure = IF(MAX([datediff day])<=[Threshold Value],"not delay","delay")
Measure 2 = var p=(MAX([datediff day])-[Threshold Value])/[Threshold Value] return IF([Measure]="delay",IF(p<=[Pencentage Value],"accepted delay","over threshold"))
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks so much @v-juanli-msft !! You are a heroo!!
I tried to do some calculations without the what if flter but by creating the same formula by having a table where I used generateseries but the calculations do not work only with the generateseries dax. It has to be set as a parameter to work. Do you maybe know why that is not calculating it right?
Hi @userdata
Create two what-if paramter as link i post above
create them using UI, then you will get formual below automcatically.
Threshold = GENERATESERIES(0, 50, 1)
Pencentage = GENERATESERIES(0, 1, 0.0010)
Create measures
Measure = IF(MAX([datediff day])<=[Threshold Value],"not delay","delay")
Measure 2 = var p=(MAX([datediff day])-[Threshold Value])/[Threshold Value] return IF([Measure]="delay",IF(p<=[Pencentage Value],"accepted delay","over threshold"))
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @userdata
Please use what-if parameter to create a slicer which can let users enter numbers.
https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-what-if
Best Regards
Maggie
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |