Forum Discussion

DamianMcc's avatar
DamianMcc
Frequent Visitor
2 years ago
Solved

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: 

 

What I'm trying to achieve is: 

 

 

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

 

 

 

 

 

 

 

 

 

 

 

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    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]

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

    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. 

     

     

1 Reply

  • Anonymous's avatar
    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]

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

    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.