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
Anonymous
Not applicable

slicers

Hi, I have created a very simle line chart with time on the x horizontal axis and quatity on the y vertical axis.  I have three data sets showing three separate lines - how do I get a slicer to operate on the three data lines ie able to select which or how many lines are shown?  Any help appreciated.

2 ACCEPTED SOLUTIONS

Hi @Anonymous ,

 

You measures for each column should be something like this:

 

Measure G = 
IF (
    CONTAINS ( MeasuresSelection; MeasuresSelection[Measure]; "Measure G" );
    SUM ( Table1[G] );
    BLANK ()
)

Measure M =
IF (
    CONTAINS ( MeasuresSelection; MeasuresSelection[Measure]; "Measure M" );
    SUM ( Table1[M] );
    BLANK ()
)

Then add this measures to your chart and the slicer based on the measure selection table.

 

See attach PBIX file.

 

Regards,

Mfelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

How do you have the slicer table setup?

Do not make any relationship with your data table.

Regards,
MFelix

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

14 REPLIES 14
MFelix
Super User
Super User

Hi @Anonymous ,

 

Check this video that contains a description how to have turn off and on slicer for measures in a chart.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Still no luck, followed video to the letter and still only get the table and slicer to work in harmony - the chart remains unaffected my slicer selections.

Hi @Anonymous ,

 

Can you share a sample of your file please?

 

If the information is sensitive please shared it trough private message.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Hi, thganks for you interest - what is the best way to send/share my files?

Hi @Anonymous ,

 

Send a web link for onedrive, google drive, we transfer or similar.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

https://lloydsregistergroup-my.sharepoint.com/:x:/g/personal/stuart_ainsworth_lr_org/EfgLBZTB5ZBMpw5...

 

Very basic data set, I then created 2 new measures to copy the initial data and allow the CONTAINS amendment to be made.  I set up the xTable as instructed but only the slicer (xTable) and the table visualisation are changed when using the slicer. 

 

https://lloydsregistergroup-my.sharepoint.com/:u:/g/personal/stuart_ainsworth_lr_org/EeJWKtI2QRFElfK...

Hi @Anonymous ,

 

This is pointing to a closed sharepoint group (probably from your company) don't have access to the file.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Hi @Anonymous ,

 

You measures for each column should be something like this:

 

Measure G = 
IF (
    CONTAINS ( MeasuresSelection; MeasuresSelection[Measure]; "Measure G" );
    SUM ( Table1[G] );
    BLANK ()
)

Measure M =
IF (
    CONTAINS ( MeasuresSelection; MeasuresSelection[Measure]; "Measure M" );
    SUM ( Table1[M] );
    BLANK ()
)

Then add this measures to your chart and the slicer based on the measure selection table.

 

See attach PBIX file.

 

Regards,

Mfelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

I need to wait until tomorrow to get the latest version of Power BI downloaded by my IT department so cannot open you file (yet).  can you expalin why the sum function, this just flat lined my graph.  I added you measures in but still the slicer does not work, do I need to apply the measure to the selection table(s) as well?

How do you have the slicer table setup?

Do not make any relationship with your data table.

Regards,
MFelix

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Hi MFelix,

 

Dowloaded your fileand have amended your scripts to make the visualisations work.  My only concern from an understanding perspective, is why the Sum function is needed in the 'TRUE' statement for the CONTAINS function?  When I added this in I got (what I expected) which was a sum of the table columns so a flat line.

 

I also had set up new columns rather than measures which I think had somethin to do with it.  Anyway, heartfelt thanks for your tim and patience with my query you are a star.

Hi @Anonymous ,

 

The values that I provided was for Measures not columns, the SUM is not part of the TRUE is the result of the IF function when the CONTAINS is TRUE.

 

You can use the SUM functionor reference it to another measure depends on the results you want. Looking at the measure I provided:

 

Measure G = 
IF (
    CONTAINS ( MeasuresSelection; MeasuresSelection[Measure]; "Measure G" ); // Check if the Measure G is selected on the slicer
    SUM ( Table1[G] ); // Returns the sum of Column G if Measure G is selected on the slicer
    BLANK () // Returns blank if Measure G is not selected on the slicer
)

Regards,

MFelix

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

The video was excellent as a new starter to Power BI.  I have not yet got the solution to work with my datasets so will try again today.  I create the tables but the line graph refuses to follow the slicer selections.

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.