Forum Discussion

RockandGrohl's avatar
RockandGrohl
Frequent Visitor
7 months ago
Solved

Creative Solution Required - User input fields on a Scatter Chart

Went down the AI rabbit hole already and got some nonsense out, though it looked promising.   What I'm trying to do is have a scatter chart on Power BI and allow the user to input their own X & Y v...
  • AshokKunwar's avatar
    7 months ago

    Hii RockandGrohl 

     

    Use will create two numeric parameters and then use a measure that "injects" those parameters as a new data point into your chart.

    Step 1: Create the Numeric Range Parameters

    ​Go to Modeling > New Parameter > Numeric Range for both your X and Y values:

    1. Input X: (e.g., Range 0 to 1000) -> Creates a table Input X and a measure [Input X Value].
    2. Input Rate: (e.g., Range 0 to 500) -> Creates a table Input Rate and a measure [Input Rate Value]. Add these as Slicers on your report page.

    Step 2: Create the "Combined" Measures

    ​You need to create X and Y measures that return the database values for your products plus the parameter value for a "Virtual Product."

    X-Axis Measure:

    Plot X = 
    IF(
        SELECTEDVALUE('Database'[Product_ID]) = "USER_INPUT", 
        [Input X Value], 
        MAX('Database'[Quant 1])
    )

     

    Y-Axis Measure:

    Plot Rate = 
    IF(
        SELECTEDVALUE('Database'[Product_ID]) = "USER_INPUT", 
        [Input Rate Value], 
        MAX('Database'[Rate])
    )

     

    Step 3: The "Dummy Row" Trick

    ​For the measures above to work, the chart needs a "row" to attach the user input to.

    1. ​In your Excel/SQL source, add one "Dummy" row to your Database table.
    2. ​Set the Product_ID (or Name) of this row to "Your Quote".
    3. ​Leave the Quant 1 and Rate for this specific row as 0 or Blank.

    Step 4: Configure the Visual

    1. ​Drag Product_ID to the Values bucket.
    2. ​Drag [Plot X] to the X-Axis bucket.
    3. ​Drag [Plot Rate] to the Y-Axis bucket.
    4. Formatting: Go to Markers > Color and use Conditional Formatting. Set the color to Red if the Product_ID is "Your Quote", and Blue for everything else.

    Why this works:

    • Single Axis: You are only using one Y-axis, but the measure dynamically changes its logic based on which row it is currently plotting.
    • Interactivity: As the user moves the sliders, the "Your Quote" dot will move live across the screen while the database dots remain static.

    Summary for the Community

    ​Don't try to add a second Y-axis. Instead, add a Dummy Row to your data and use DAX Measures to swap that row's coordinates with your Numeric Range Parameter values.

     

    If this "Virtual Point" strategy allows you to compare your quotes against the database, please mark this as the "Accepted Solution"!