cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Post Partisan

## Slicer

Hi Masters,

I have a grpah with multiple lines created by dax with each data columns like below.

Now what i want is having a slicer of each lines. I want to show one line in the graph using the slicer.

1 ACCEPTED SOLUTION
Super User

@colourfullife

Yes, it is possible. Since you have a measure for each line in the graph, create a table using the Enter Data option on the Home ribbon. Enter All the measure names that you use in the charts. Insert a slicer and drop the measure names.

Modify each measure to check if the particular measure is selected in white, this way you can select what to display on the chart.
You can even select multiple measures.

________________________

If my answer was helpful, please consider Accepting it as the solution to help other members find it

Click the Thumbs-Up icon if you like this🙂🙂

Did I answer your question? Mark my post as a solution! and hit thumbs up
12 REPLIES 12
Community Champion

Here is one way of doing this.

1) create a new table with the names of your measures by selecting the "Enter Data" option in the Home tab in the ribbon. For my example I'm working with 4 measures, so here is my new table (I've called it 'Slicer by measure'):

2) now create a new measure which will deliver the measure based on the selection made in the new slicer:

``````Selected Measure by Slicer = SWITCH(TRUE(),
SELECTEDVALUE('Slicer by measure'[Name Measure]) IN {"Sales for 1A"}, [Sales for 1A],
SELECTEDVALUE('Slicer by measure'[Name Measure]) IN {"Sales for 2B"}, [Sales for 2B],
SELECTEDVALUE('Slicer by measure'[Name Measure]) IN {"Sales for 3C"}, [Sales for 3C],
[Sales for 4D])``````

3) Create you line chart using this last measure, [Selected Meaure by Slicer], add the slicer to the page, and you get this:

In doing so, you are also helping me. Thank you!

Proud to be a Super User!

Post Partisan

one question, can i put 2 lines in the graph using the filter?

Super User

@colourfullife

Yes, it is possible. Since you have a measure for each line in the graph, create a table using the Enter Data option on the Home ribbon. Enter All the measure names that you use in the charts. Insert a slicer and drop the measure names.

Modify each measure to check if the particular measure is selected in white, this way you can select what to display on the chart.
You can even select multiple measures.

________________________

If my answer was helpful, please consider Accepting it as the solution to help other members find it

Click the Thumbs-Up icon if you like this🙂🙂

Did I answer your question? Mark my post as a solution! and hit thumbs up
Post Partisan

@Fowmy  i made a table using enter data in home tab.

after what do i need to do?

Super User

@colourfullife

Modify each measure to include the condition to show the selected measure. Check my file and you will understand how it works.
I provided the steps in my original reply.

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

Did I answer your question? Mark my post as a solution! and hit thumbs up
Post Partisan

@Fowmy  yes, i thought i understood your steps and followed but the result doesn't come out like yours.

did i miss something here?? if so please let me know.!

Super User

@colourfullife

Make sure you are typing the same value in the measure as in the Slicer Table "PO (CDD)", you have space at then like "PO (CDD) "

Hope you make a slicer and inserted the Slicer column there?

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

Did I answer your question? Mark my post as a solution! and hit thumbs up
Post Partisan

I tried to open the link but got this error message..

and can you please let me know which video i need to refer in the youtube channel ?

thanks,

CL

Super User

@colourfullife

Can you check the link now?

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

Did I answer your question? Mark my post as a solution! and hit thumbs up
Post Partisan

@Fowmy  still got the same error message. 😞

is it because i didn't have a latest version of PBI? hmm

is there any way to share the file? i feel like you have what i am after!

Super User

@colourfullife

Send me your email to the private Message.

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

Did I answer your question? Mark my post as a solution! and hit thumbs up
Super User

@colourfullife , This one is tricky.

if the line is because of legend, create a slicer on the legend

So you need control multiple lines with the slicer

line 1 measure =
var _max =maxx(Filter(allselected(Slicer[value]),Slicer[value] ="Line1"), [Value])
return
if(_max = null , blank(), [measure])

line 2 measure =
var _max =maxx(Filter(allselected(Slicer[value]),Slicer[value] ="Line2"), [Value])
return
if(_max = null , blank(), [measure])

if need one line at a time , refer