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

Visual to make a Linechart clearer/ filter columns

Hi guys,

is it possible to filter the lines in Power Bi with a visual?

kelu_0-1604478829253.png

The lines in the line chart represent different locations (each line is a column). But as you can see it is very confusing, there is a visual with which I can quickly display only 2 or 3 lines. So I am looking for a more elegant solution than having to delete or add the columns one by one to the line chart.

 

greetings Lukas

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

I have create a simple sample data for your reference. Here is my sample data:

Capture.PNG

Capture1.PNG

First we need to create a new table that contains all value your want to show in legend:

Capture2.PNG

 

Then use the column in the new table for legend of line chart and the following measure as Value of line chart:

 

measure = SWITCH(SELECTEDVALUE(Slicer[slicer]),"legend1",SUM('Table'[legend1]),"legend2",SUM('Table'[legend2]),"legend3",SUM('Table'[legend3]))

 

Capture3.PNG

Then you can use the slicer for controlling the legends you want to show:

 

Capture4.PNG

 

For more details, please refer to the pbix file: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/Eb1bSm7LP61DgMLXwhMnfiIBrLwO_3-DUZn-Y2NS241NFw?e=gZhTRd

 

If this post help, please consider accept it as the solution to help other member find it more quickly.

 

Best Regards,

Dedmon Dai

 

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

https://radacad.com/change-the-column-or-measure-value-in-a-power-bi-visual-by-selection-of-the-slic...

So the link helped a bit but with this trick I can only show one line at a time. But it would be useful if you could display several lines at the same time to compare the different values.

 

Thanks a lot

Hi @Anonymous ,

 

I have create a simple sample data for your reference. Here is my sample data:

Capture.PNG

Capture1.PNG

First we need to create a new table that contains all value your want to show in legend:

Capture2.PNG

 

Then use the column in the new table for legend of line chart and the following measure as Value of line chart:

 

measure = SWITCH(SELECTEDVALUE(Slicer[slicer]),"legend1",SUM('Table'[legend1]),"legend2",SUM('Table'[legend2]),"legend3",SUM('Table'[legend3]))

 

Capture3.PNG

Then you can use the slicer for controlling the legends you want to show:

 

Capture4.PNG

 

For more details, please refer to the pbix file: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/Eb1bSm7LP61DgMLXwhMnfiIBrLwO_3-DUZn-Y2NS241NFw?e=gZhTRd

 

If this post help, please consider accept it as the solution to help other member find it more quickly.

 

Best Regards,

Dedmon Dai

 

 

amitchandak
Super User
Super User

@Anonymous , If the line is because of legend, you can control it by a slicer .

 

Otherwise you have to create an independent table of all measure name and create all measures like

 

Projectvalue =
var _flag = countx(allselected(Measure), 'Measure'[Measure] in {"Project Value"})+0
return
if(_flag>0, sum(data[Project Value]), blank())


Forecast =
var _flag = countx(allselected(Measure), 'Measure'[Measure] in {"Forecasted Project Value"})+0
return
if(_flag>0, sum(data[Forecasted Project Value]), blank())

 

Also refer

measure slicer
https://radacad.com/change-the-column-or-measure-value-in-a-power-bi-visual-by-selection-of-the-slicer-parameter-table-pattern
https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/500115

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.