cancel
Showing results for
Did you mean:
Frequent Visitor

## Creating a slicer for a line graph for 6 data points coming from 4 different tables

Hello,

I currently have a graph with 6 data points coming from 4 different tables (making it 6 lines in total on the line graph). The line graph seems too complex and hard to drill down to with all 6 lines. So I am trying to create a slicer for whenever I click on a data point, a line will appear on the graph; and if I click on two data points, 2 lines will appear on the graph, etc.

Any idea of how to do that?

I currently created a dummy table to have the 6 data points (value that I want to slice on  -cost 1 to cost 6). In my main table, I created a column with the formula below, but I keep getting the error saying "A table of multipla values was supplied where a single value was expected". What should I do? Any suggestions/help would be greatly appreciated.

Trial = SWITCH(VALUES('dummy'[cost column]),"Cost 1",SUM('database'[cost 1]),"Cost 2",SUM('database'[cost 2]),"Cost 3",'Excel1'[Cost 3],"Cost 4",'Excel 2'[Cost 4],"Cost 5",'Database2'[Cost 5],"Cost 6",'Excel 2'[Cost 6],SUM('database'[cost 1]))

So my ideal plan is that cost 1 will be on the graph no matter whether any slicer is selected for the graph. If I click on cost 2 on the slicer, both cost 1 and cost 2 will show up in the line graph.

Thank you guys.

3 REPLIES 3
Super Contributor

## Re: Creating a slicer for a line graph for 6 data points coming from 4 different tables

Hi @Jolly123,

Seems you just need to add the legend in a slicer like below.

The error is raised by "VALUES('dummy'[cost column])" which returns a table.

Best Regards,

Dale

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

## Re: Creating a slicer for a line graph for 6 data points coming from 4 different tables

Good morning Dale,

Thank you for your response. The reason why I created a dummy table is because the 6 fields that I want to put on 1 single line graph are coming from 4 different tables. I think your example will work well if I want a line graph that data is all coming from one field only. However, the 6 lines that I would like to have on my line graph is coming from 6 differenf fields from 4 different tables. I created a dummy table to call out the 6 fields that I would like to filter for the line graph. For example, I would like to have "Cost 1" to always be on the graph no matter which filter I choose (because that's the cost I want it to be compared to). If I click on "Cost 2" on the slicer/filter, I would like the line for Cost 2 to appear on the line graph, and Cost 1 will be there too as a default. Do you have any idea how to do it? Any help will be greatly appreciated. Thank you.

Super Contributor

## Re: Creating a slicer for a line graph for 6 data points coming from 4 different tables

Hi @Jolly123,

Can you share a sample data?

Best Regards,

Dale

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

Announcements

#### Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

#### Community News & Announcements

Get your latest community news and announcements.

#### Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

#### Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Top Kudoed Authors
Users Online
Currently online: 59 members 1,202 guests
Recent signins: