cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
iamriz
Helper II
Helper II

How to filter 3 Matrix tables with one date sync slicer - 2 tables reflecting past 2 months?

Hello, I am having a hard time figuring out how to have a single date sync slicer that would filter 3 Matrix tables - 2 of which reflecting past 2 months?

 

Please see attached Sample Data pbix file. How to retain the 3rd date sync slicer that would achieve the table 1 and 2 count values?

 

I hope someone could help. Thanks in advance.

1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hi, @iamriz 

According to your description and sample file, I guess you want to make a Slicer filter three tables(current, 1 month ago, 2 month ago), you can try my steps:

  1. Create a Calendar table for Slicer:
Date = CALENDARAUTO()
  1. Create these measures for Table1, Table2, Table3:
Count_Table1 =

var _selecteddate=MIN('Date'[Date])

return

CALCULATE(COUNT(Orders[OrderID]),

FILTER('Orders',

[Datetime]>=DATE(YEAR(_selecteddate),MONTH(_selecteddate)-1,DAY(_selecteddate))&&

[Datetime]<_selecteddate))
Count_Table2 =

var _selecteddate=MIN('Date'[Date])

return

CALCULATE(COUNT(Orders[OrderID]),

FILTER('Orders',

[Datetime]>=DATE(YEAR(_selecteddate),MONTH(_selecteddate)-2,DAY(_selecteddate))&&

[Datetime]<DATE(YEAR(_selecteddate),MONTH(_selecteddate)-1,DAY(_selecteddate))))
Count_Table3 =

CALCULATE(COUNT(Orders[OrderID]),FILTER('Orders','Orders'[Datetime]>=MIN('Date'[Date])&&'Orders'[Datetime]<=MAX('Date'[Date])))

 

  1. Replace the field of Slicer with ‘Date’[Date], replace [Count] in Tables with new measures, then open visual interactions, like this:

v-robertq-msft_0-1606293501115.png

 

And you can get what you want.

You can download my test pbix file here

 

Best Regards,

Community Support Team _Robert Qin

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

View solution in original post

2 REPLIES 2
v-robertq-msft
Community Support
Community Support

Hi, @iamriz 

According to your description and sample file, I guess you want to make a Slicer filter three tables(current, 1 month ago, 2 month ago), you can try my steps:

  1. Create a Calendar table for Slicer:
Date = CALENDARAUTO()
  1. Create these measures for Table1, Table2, Table3:
Count_Table1 =

var _selecteddate=MIN('Date'[Date])

return

CALCULATE(COUNT(Orders[OrderID]),

FILTER('Orders',

[Datetime]>=DATE(YEAR(_selecteddate),MONTH(_selecteddate)-1,DAY(_selecteddate))&&

[Datetime]<_selecteddate))
Count_Table2 =

var _selecteddate=MIN('Date'[Date])

return

CALCULATE(COUNT(Orders[OrderID]),

FILTER('Orders',

[Datetime]>=DATE(YEAR(_selecteddate),MONTH(_selecteddate)-2,DAY(_selecteddate))&&

[Datetime]<DATE(YEAR(_selecteddate),MONTH(_selecteddate)-1,DAY(_selecteddate))))
Count_Table3 =

CALCULATE(COUNT(Orders[OrderID]),FILTER('Orders','Orders'[Datetime]>=MIN('Date'[Date])&&'Orders'[Datetime]<=MAX('Date'[Date])))

 

  1. Replace the field of Slicer with ‘Date’[Date], replace [Count] in Tables with new measures, then open visual interactions, like this:

v-robertq-msft_0-1606293501115.png

 

And you can get what you want.

You can download my test pbix file here

 

Best Regards,

Community Support Team _Robert Qin

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

View solution in original post

Hi @v-robertq-msft , just what I was looking for. This is very helpful, thank you very much!!!

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors