Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
81 | |
76 | |
61 | |
37 | |
33 |
User | Count |
---|---|
99 | |
56 | |
50 | |
42 | |
40 |