Forum Discussion

hemantprajapati's avatar
hemantprajapati
Microsoft Employee
1 year ago
Solved

How to add numeric input parameter in PowerBI

Hello Anonymous I am looking to add a numeric input parameter in PBI. It is does not belong to any dataset as well as there is no numeric range for it. It should be just a simple input parameter bas...
  • Kaviraj11's avatar
    1 year ago

    Hi,

     

     Here's a step-by-step guide to help you set it up:

    Create a What-If Parameter:

    • Go to the Modeling tab in Power BI Desktop.
    • Click on New Parameter and select What-If Parameter.
    • In the dialog box, set the following:
      • Name: Give your parameter a name, e.g., "Input Parameter".
      • Data Type: Select Whole Number or Decimal Number based on your requirement.
      • Minimum and Maximum: Set these to a wide range if you don't have specific limits.
      • Increment: Set this to 1 or any other value that suits your needs.
      • Default Value: Set an initial value for the parameter.
      • Click OK. This will create a new table with the parameter values and a slicer for the parameter.

        Use the Parameter in Calculations:

        • You can now use this parameter in your DAX calculations. For example:
          Result = SUM('YourTable'[YourColumn]) * SELECTEDVALUE('Input Parameter'[Input Parameter])

           

          Add the Slicer to Your Report:

          • Drag the newly created parameter slicer to your report canvas.
          • Users can now adjust the parameter value using the slicer, and your calculations will update accordingly.
  • Thejeswar's avatar
    Thejeswar
    1 year ago

    Hi hemantprajapati ,

    Whatever Anonymous suggested for data input into the measure can be done from Power BI Desktop only.

     

    I would go with what Kaviraj11 suggested. WhatifParameters would be the right thing to go.

     

    If you are worried about limiting to a certain number, then you should probably give a higher number that is likely not limiting the user from what they need. You can also swith off the slider to give them the feel of a input box. There is also a text box slicer in the custom visual that you can use for this purpose. This Text Box slicer also needs a column of values at the backend

     

    However, be aware, what if parameters will create a calculated table at the backend which could be very big if you are going to give an extremely big number as your MAX value.

     

    The Below are the screeshots

    slicer wIth slider swithed off

     

    Text Box slicer custom visual

     

     

    Regards,