cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ankitkagarwal88 Frequent Visitor
Frequent Visitor

Creating a Single Slicer for Multiple Column

Hi,

 

I have data in two different tables in two different file as mentioned below. Want to put one common slicer for both on the month to show the monthly variance for below two tables. If I select any month from the slicer the graph will show that month data only from Table 1 & Table 2.

Capture.JPG

Crux: need to put slicer for the data in columns.

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator v-yuezhe-msft
Moderator

Re: Creating a Single Slicer for Multiple Column

@ankitkagarwal88,

1. Unpivot your columns of Table 1 and Table 2 in Query Editor of Power BI Desktop.
1.JPG

2. Rename Attribute column in Table 1 and Table 2 to Month.

3. Create a new table using DAX below.
Table = DISTINCT(SELECTCOLUMNS('Table 1',"Month", 'Table 1'[Month]))

4. Create relationship using Month field among the three tables.
2.JPG

5. Create slicer using the Month field of the new table, then you are able to use the slicer to filter your visuals.
3.JPG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
5 REPLIES 5
BeemsC Member
Member

Re: Creating a Single Slicer for Multiple Column

Hello,

If you create a relationship between the tables, filters will work on both.

Alternatively you can create a new date table and link them both to your new table.
Then you use that data for filtering purposes.
Use this link for more information about a date table:
https://kohera.be/nl/blog/business-intelligence-nl/how-to-create-a-date-table-in-power-bi-in-2-simpl...

 

Good luck

Moderator v-yuezhe-msft
Moderator

Re: Creating a Single Slicer for Multiple Column

@ankitkagarwal88,

1. Unpivot your columns of Table 1 and Table 2 in Query Editor of Power BI Desktop.
1.JPG

2. Rename Attribute column in Table 1 and Table 2 to Month.

3. Create a new table using DAX below.
Table = DISTINCT(SELECTCOLUMNS('Table 1',"Month", 'Table 1'[Month]))

4. Create relationship using Month field among the three tables.
2.JPG

5. Create slicer using the Month field of the new table, then you are able to use the slicer to filter your visuals.
3.JPG

Regards,
Lydia

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

Re: Creating a Single Slicer for Multiple Column

Thanks for your help....It is working now.:smileyhappy Smiley Happy

Highlighted
ankitkagarwal88 Frequent Visitor
Frequent Visitor

Re: Creating a Single Slicer for Multiple Column

Hi Lydia,

 

Thanks for your help!!

 

Can you please help me with the variance calcualtion between the tables.

 

Like (Value of table 1-value of table 2)/value of table 1

 

ThanksCapture1.JPG

Moderator v-yuezhe-msft
Moderator

Re: Creating a Single Slicer for Multiple Column

@ankitkagarwal88,

1. Merge the two tables in Query Editor useing Merge Queries->Merge as new functionality, then expand the value field in the Merged table.
1.JPG2.JPG

2. Create relationship between the Table and Merged table using Month field, create a calculated column in the merged table using dax below.

Column = (Merge1[Table 1.Value]-Merge1[Value])/Merge1[Table 1.Value]
3.JPG

Regards,
Lydia

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

Helpful resources

Announcements
Community Highlights

Community Highlights

Find out what's new in the Power BI Community!

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 112 members 1,660 guests
Please welcome our newest community members: