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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.