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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
DamianMcc
Frequent Visitor

How to create a relative date slicer using direct query

I'm creating a report which is directly querying the source. 

I've come to realise that date hierarchies are not a thing in direct query. I need to use direct query because we're using RLS to filter the data at the MS SQL source. 

 

I have created a custom date hierarchy with year, month, and day within and can assign this to a slicer; however, this doesn't give me the desired result. 

 

I have so far: 

DamianMcc_0-1697733994318.pngDamianMcc_1-1697734002816.pngDamianMcc_3-1697734027936.png

 

What I'm trying to achieve is: 

 

DamianMcc_5-1697734109817.png

 

How do I create a relative date slicer from a 'date' field which looks like the below?

 

DamianMcc_6-1697734176770.png

 

 

 

 

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @DamianMcc ,

 

You can place the Date field directly on the slicer visual object.

If your original data is in the Year, Month, and Day columns, then you can create a Calculated column.

DateColumn = [Year]& "/" & [Month] & "/" & [Day]

vtangjiemsft_0-1698026385377.png

You can place the DateColumn field directly on the slicer visual object.

vtangjiemsft_1-1698026622717.png

Best Regards,

Neeko Tang

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

1 REPLY 1
Anonymous
Not applicable

Hi @DamianMcc ,

 

You can place the Date field directly on the slicer visual object.

If your original data is in the Year, Month, and Day columns, then you can create a Calculated column.

DateColumn = [Year]& "/" & [Month] & "/" & [Day]

vtangjiemsft_0-1698026385377.png

You can place the DateColumn field directly on the slicer visual object.

vtangjiemsft_1-1698026622717.png

Best Regards,

Neeko Tang

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

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.