0
votes

I'm pretty new at Power BI and currently I have 4 tables. Each table is for a different year: 2017, 2018, 2019, and total of all of those years. Each of these all have the same columns.

I added a "year" column in each of the tables so that Power BI can distinguish between each table.

Is it possible to create a slicer where I can select the years and only the info for that table will appear?

Thank you in advance, I will provide more info if needed.

1

1 Answers

0
votes

If your total table has the same data as your annual tables, then you don't need to switch between them. Just show the data from the total table. Add a slicer visual to your report and show the Year field from your totals table. Now when you change the value in the slicer, the data from your totals table will be filtered accordingly. In this case you won't need the annual tables.

If your totals tables doesn't contain the same data, then you need to build a new one by appending your annual tables in one. If they do not have Year column, add one and set it to the corresponding year for each table. The use the newly created total table in the scenario above.

To do these things, open Power Query Editor by clicking on Edit Queries button in the ribbon. Select each of your annual tables and from Add Column -> General click Custom Column. Name it Year and write the year of the current table:

enter image description here

When all your tables has this column, from Home -> Combine click Append Queries as New and select all your annual tables:

enter image description here

You are ready to use this combined data in your report. Add the Year column to a slicer to filter the data for particular year.