Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Use dax to create a dynamic X and Y axis

Hi, I am trying to create a dax measure that would change the x and y axis on a scatter graph tooltip based off of a selection made by the user.

 

Thanks in advance!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

We couldn't add measure into X Axis or Y Axis field in scatter visual. Here I suggest you to create a selection table and then create a measure to filter X Axis and Y Axis.

Here I create a selection with two selections. Selection1 will range X and Y from 2 to 5. Selection2 will range X and Y from 3 to 6. 

1.png

Measure:

Measure = 
IF(
ISFILTERED(Selection[Selection]), 
SWITCH(
MAX(Selection[Selection]),
"Selection1",
IF(SUM('Table'[X])<=5&&SUM('Table'[X])>=2&&SUM('Table'[Y])<=5&&SUM('Table'[Y])>=2,1,0),
"Selection2",
IF(SUM('Table'[X])<=6&&SUM('Table'[X])>=3&&SUM('Table'[Y])<=6&&SUM('Table'[Y])>=3,1,0)),
1
)

Create a Scatter visual , then add this measure into visual level filter and set it to show items when value =1. Result is as below.

By Default:

1.png

Selection1:

2.png

Selection2:

3.png

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

 

We couldn't add measure into X Axis or Y Axis field in scatter visual. Here I suggest you to create a selection table and then create a measure to filter X Axis and Y Axis.

Here I create a selection with two selections. Selection1 will range X and Y from 2 to 5. Selection2 will range X and Y from 3 to 6. 

1.png

Measure:

Measure = 
IF(
ISFILTERED(Selection[Selection]), 
SWITCH(
MAX(Selection[Selection]),
"Selection1",
IF(SUM('Table'[X])<=5&&SUM('Table'[X])>=2&&SUM('Table'[Y])<=5&&SUM('Table'[Y])>=2,1,0),
"Selection2",
IF(SUM('Table'[X])<=6&&SUM('Table'[X])>=3&&SUM('Table'[Y])<=6&&SUM('Table'[Y])>=3,1,0)),
1
)

Create a Scatter visual , then add this measure into visual level filter and set it to show items when value =1. Result is as below.

By Default:

1.png

Selection1:

2.png

Selection2:

3.png

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

So my plan was to use the scattergraph as a tooltip on a heatmap and to do that I wanted to create a measure for both X and Y fields. Is this not possible yet in powerBI? I know I can do it in python, but powerBI does not like python tooltips

Anonymous
Not applicable

Hi @Anonymous ,

 

I saw you want to use scattergraph as a tooltip on another visual. Here I suggest you to try report page tooltip function in Power BI. 

For reference: Create tooltips based on report pages in Power BI Desktop

Then create a filter measure to filter this scatter visual as above.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.