Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
userdata
Helper IV
Helper IV

How can I set up a parameter in desktop in order to create a threshold that users can choose

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

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

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"))

Capture2.JPG

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.

View solution in original post

4 REPLIES 4
v-juanli-msft
Community Support
Community Support

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?

v-juanli-msft
Community Support
Community Support

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"))

Capture2.JPG

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.

v-juanli-msft
Community Support
Community Support

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.