Forum Discussion
Creative Solution Required - User input fields on a Scatter Chart
- 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:
- Input X: (e.g., Range 0 to 1000) -> Creates a table Input X and a measure [Input X Value].
- 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.
- In your Excel/SQL source, add one "Dummy" row to your Database table.
- Set the Product_ID (or Name) of this row to "Your Quote".
- Leave the Quant 1 and Rate for this specific row as 0 or Blank.
Step 4: Configure the Visual
- Drag Product_ID to the Values bucket.
- Drag [Plot X] to the X-Axis bucket.
- Drag [Plot Rate] to the Y-Axis bucket.
- 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"!
I don't know how to paste DAX without this stupid forum complaining about HTML so I can't post the full solution, sorry, but the axis scaling issue was being caused by me having excluded some datapoints on my background Scatter chart, which meant that the DAX was looking at spotting a max Quantity of, say, 450, when my chart was only showing from 20 to 50. This was causing the scaling issues.