The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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?
Solved! Go to Solution.
Hi @Anonymous ,
Maybe you can do like this.
1. Create a table.
2. Create a slicer.
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.
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
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.
2. Create a slicer.
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.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
100 | |
94 | |
80 | |
63 | |
56 |
User | Count |
---|---|
248 | |
122 | |
110 | |
77 | |
70 |