Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
mvmania
Regular Visitor

Slicer by Column

Hi, I am very new to use Power BI. Thank you in advance for your answers.

I developed a table like below 

 

Project              Budget 2016               Budget 2017                  

Project1                1000                             1022

Project2                  1111                            1023

Project3               1112                               1032

...                             ...                                    ...

 

I would like to use slicer to show budget in 2016 and 2017 in one chart. In other words, if I click Budget 2016 in slicer, the chart shows information only based on data from column 'budget 2016', and if I click Budget 2017 in slicer, the chart shows that only based on data from column budget 2017.

Could you please let me know how? I am struggling with this for hours but to no avail.

Great thanks.

 

 

1 ACCEPTED SOLUTION

Go to the query editor, highlight both 2016 and 2017 columns (shift + mouse click), then click "unpivot columns" in the Transform tab. This will give you 2 columns: budget and year. Notice how your rows for project number have doubled, with a row for 2016 and a row for 2017. Now you can create a chart with the budget field for the value, and add a slicer with budget year as field that will filter the chart.

View solution in original post

2 REPLIES 2

Go to the query editor, highlight both 2016 and 2017 columns (shift + mouse click), then click "unpivot columns" in the Transform tab. This will give you 2 columns: budget and year. Notice how your rows for project number have doubled, with a row for 2016 and a row for 2017. Now you can create a chart with the budget field for the value, and add a slicer with budget year as field that will filter the chart.

Thank you very much for this simple and great solution.

You saved me!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.