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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
arelf27
Helper II
Helper II

Dynamic slicer

I have a scatter chart visual with x and y - axis that are actually calculated columns... I'd like this visual to be dynamic.. I have 7 different calculated columns to choose from, so I'd like a user to be able to choose one of 7 calculated columns for X-axis and the same 1 of 7 calculated columns for Y-axis... I was able to achieve that quite easily by creating two slicers that each contain X and Y - axis values (behind each slicer is a table "X Axis Slicer" and "Y Axis Slicer" respectively..) and a measure:

 

testMeasure = if(SELECTEDVALUE('X Axis Slicer'[X Values]) = "A", CalculatedColumnA,
IF(SELECTEDVALUE('X Axis Slicer'[X Values]) = "B", CalculatedColumnB,
CalculatedColumnC))

 

So when I use this measure for X and Y - axis on the graph and switch between diff. selections of my X and Y slicers it all works...

 

However here's the problem: I need to have two more slicers to be able to manipulate the min and max values that are seen on my graph.. When I create a calculated column and use the same If statement as above it doesn't work since Calculated Columns do not see filters... So essentially it always goes to else...  (creating Calculated Column and setting it equal to measure works the same, where it no longer sees the filter and goes to else...)   Also I can't just use a Measure since Slicers do not work with measures..   One thing that I think could work is if all my Calculated Columns where unpivoted into one big column so the entire table can be filtered down by 1st slicer and then the second slicer can pick up the values.. However since all these columsn I'm using are Calculated columns I cannot see them in Edit Queries.. Also looks like we cannot unpivot using DAX? 

 

Essentially the way this works for me right now is I have my 7 slicers on page and user can pick two...  to match the dimensions they've set to see on the graph...  Anyway I can get to only have 2 slicers?   It seems the problem is circular where all the options I'm trying to do do not work because of something or other....

 

 

 

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@arelf27,

We are unable to see the sample data of your  table, but there are workarounds for your issue.

1. Instead of using calculated columns, create custom columns in Query Editor.
2. Convert these calculate columns into rows by using DAX, there is a similar thread for your reference.


Regards,
Lydia

Community Support Team _ Lydia Zhang
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

1 REPLY 1
v-yuezhe-msft
Employee
Employee

@arelf27,

We are unable to see the sample data of your  table, but there are workarounds for your issue.

1. Instead of using calculated columns, create custom columns in Query Editor.
2. Convert these calculate columns into rows by using DAX, there is a similar thread for your reference.


Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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