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
Anonymous
Not applicable

Help with Parameters

I have a lot of calcuations that depend on user input so I need parameters.  Most of the parameters are Yes/No questions, for example, include Lunch in Calculations? If yes, then the calculation would deduct lunch hours from the total and if no, it would not.  More like that.  The way I've done parameters is on the Modeling tab, What-if Parameter, but I see these are only used for numbers.  So I also read about Manage Parameters from the Query Editor window.  Is this where I would create my parameters?  And if so, how would I then add them to my report to get the answer, and use the answer in the cacluations?

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Maybe you can do like this.

1. Create a table.

v-lionel-msft_0-1602146436067.png

2. Create a slicer.

v-lionel-msft_1-1602146474413.png

Measure = 
IF(
    SELECTEDVALUE('Table'[Parameter]) = "Yes", 
     [Total Worked] + [Lunch Break],
     [Total Worked]
)

Or create a ‘What If’ parameter and use the numbers 0, 1 instead of ‘Yes’ and 'No'.

If the problem is not resolved, please show me sample data.

 

Best regards,
Lionel Chen

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

3 REPLIES 3
Pragati11
Super User
Super User

Hi @Anonymous ,

 

I think you will need to add some sample data and screenshots to your query. It's hard tounderstand how you are rrying to use parameters and in what scenario.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Well for example I need a parameter, Include Lunch?  Yes/No.  The formula would look like:

 

Total Hours =  IF(Lunch Parameter = "YES", [Total Worked] + [Lunch Break], [Total Worked])

 

Just something simple like that.  

 

 

Hi @Anonymous ,

 

Maybe you can do like this.

1. Create a table.

v-lionel-msft_0-1602146436067.png

2. Create a slicer.

v-lionel-msft_1-1602146474413.png

Measure = 
IF(
    SELECTEDVALUE('Table'[Parameter]) = "Yes", 
     [Total Worked] + [Lunch Break],
     [Total Worked]
)

Or create a ‘What If’ parameter and use the numbers 0, 1 instead of ‘Yes’ and 'No'.

If the problem is not resolved, please show me sample data.

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

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.