Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I need to build an XY plot and I have filters for both X-name and Y-name, where the values are the same.
Data Columns: name, value
Solved! Go to Solution.
Hi @ribisht17 ,
Sorry for the late response.
Please find the below snap and attached PBIX file.
If my response has resolved your query, please mark it as the "Accepted Solution" to assist others. Additionally, a "Kudos" would be appreciated if you found my response helpful.
Thank you
Hi @SSSBI ,
Thank you for reaching out to the Microsoft Community Forum.
Please follow below steps.
1. Create Parameters / Slicers:
X-name Slicer: Create a slicer visual. Use the name column. Set single-select ON.
Y-name Slicer: Create another slicer visual. Use the name column. Set multi-select ON.
2. Create Supporting Measures / Tables:
a. Create a Filtered Table for X-Axis
X_Values =
VAR SelectedX = SELECTEDVALUE('Table'[name])
RETURN
FILTER(
'Table',
'Table'[name] = SelectedX
)
b. Create a Filtered Table for Y-Axis
Y_Values =
VAR SelectedY = VALUES('Table'[name])
RETURN
FILTER(
'Table',
'Table'[name] IN SelectedY
)
3. Build a Combined Table for XY Plot: To pair values by index or row number, add row numbers first.
a. Add Indexes per Name: Use Power Query to group by name, then add an index per group.
b. Create a Combined Table:
XY_Combined =
VAR XName = SELECTEDVALUE('Table'[name])
VAR XTable =
ADDCOLUMNS(
FILTER('Table', 'Table'[name] = XName),
"Index", RANKX(FILTER('Table', 'Table'[name] = XName), 'Table'[value], , ASC)
)
VAR YNames = VALUES('Table'[name])
VAR YTable =
ADDCOLUMNS(
FILTER('Table', 'Table'[name] IN YNames),
"Index", RANKX(FILTER('Table', 'Table'[name] IN YNames), 'Table'[value], , ASC)
)
RETURN
SELECTCOLUMNS(
NATURALINNERJOIN(XTable, YTable),
"X", XTable[value],
"Y", YTable[value]
)
4. Create the XY Scatter Plot
Use the final XY_Combined table.
X-axis → X & Y-axis → Y. This will plot filtered values based on slicer selections. Axis will auto-scale due to default Power BI behavior (based on data range).
If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.
Thank you
Hi @SSSBI ,
If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.
Thank you
Hi @SSSBI ,
If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.
Thank you
Hi @SSSBI ,
If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.
Thank you
Can you share the PBIX file ?
Hi @ribisht17 ,
Sorry for the late response.
Please find the below snap and attached PBIX file.
If my response has resolved your query, please mark it as the "Accepted Solution" to assist others. Additionally, a "Kudos" would be appreciated if you found my response helpful.
Thank you
Hello @SSSBI
X_Rank = RANKX(ALLSELECTED('Table'), 'Table'[Value], , ASC, DENSE)
Y_Rank = RANKX(ALLSELECTED('Table'), 'Table'[Value], , ASC, DENSE)
In this video you can find 3 ways > 3+ approaches for Dynamic Axis in Power BI - YouTube
You can see a similar Solution here > Single scatter chart w/ dynamic XY axis - Microsoft Fabric Community
Regards,
Ritesh
Community Champion
Please mark the answer if helpful so that it can help others
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 59 | |
| 46 | |
| 39 | |
| 38 | |
| 21 |
| User | Count |
|---|---|
| 176 | |
| 131 | |
| 118 | |
| 82 | |
| 54 |