cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

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

Accepted Solutions
Highlighted
Community Support
Community Support

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

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
Highlighted
Community Support
Community Support

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

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

Highlighted
Community Support
Community Support

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

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

Highlighted
Community Support
Community Support

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

Highlighted
Helper I
Helper I

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

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?

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Top Solution Authors
Top Kudoed Authors