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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
tempranello
Advocate I
Advocate I

Single date slicer across multiple queries

Hi there

 

I just want to make sure that I've not missed a trick here:

 

I'd like to present a page of visualisations and have a single time slicer filter all of the charts.  The trouble is that the queries upon which the charts are based are seperate (two related queries and one reference).  Each query has it's own 'Month ending' field that is a custom column of Date.EndofMonth([Created date]), but I cannot simply plop in a single time slicer that points to one of the 'Month ending' fields of one of the queries and have it affect the other charts.

 

Background:  The charts stem from different queries: All Tickets, and All Journals.  While each Ticket record is related (0:Many) to Journal records, none of the charts use this relationship as I'm plotting charts like ticket volumes over time, resolution by team, and total journal effort over time.  I also have a chart, Ticket Resolution by Team, that stems from a query that is a reference (rather than a duplicate) to the All Tickets. If I drop in a slicer that uses the All Tickets.Month ending, then it affects only the charts based on that query.

 

Am I missing a trick here?  Do I really need a slicer per query?, or is there a way that I relate all of the queries to a single 'Month ending' field to make all charts filterable from a single slicer?

 

Thanks for your help.

1 ACCEPTED SOLUTION
mike_honey
Memorable Member
Memorable Member

I would add a New Table and use this formula to generate a calendar of all required dates (with the year ending in December):

 

Dates = CALENDARAUTO(12)

 

Then I would use Manage Relationships to add relationships between that new Dates table and your existing tables. 

 

Finally I would add a slicer, using the Dates.Date column.

View solution in original post

3 REPLIES 3
mike_honey
Memorable Member
Memorable Member

I would add a New Table and use this formula to generate a calendar of all required dates (with the year ending in December):

 

Dates = CALENDARAUTO(12)

 

Then I would use Manage Relationships to add relationships between that new Dates table and your existing tables. 

 

Finally I would add a slicer, using the Dates.Date column.

Thank you, Mike!

 

Taking your advice I created a calendar table.  Instead of creating a DAX-based calendar, I chose to create one in Power Query to give me more control.  I used the Power Query code here.

 

I then cleaned up my table relationships.  I found that slicing the date in the Calendar table wouldn't work as predicted if I had spurious inactive relationships floating about.  I cleaned up my table relationships to be as simple as possible and voila!  I really snazzy single slicer now drives the entire report!

 

Woohoo!

Sounds good - thanks for the whoohoo ...

 

More effort in the query and modeling end usually pays off down the track.

 

I'm a huge PQ fan too - my example was just the quickest way to get you going.  That script is a great starting point.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.