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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Top Solution Authors