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
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
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.