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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

Relative date dynamic table

Hi All,

 

I'm using an SSAS tabular model, and need a dynamic set of 13 sequential months MMM-YY that I can drag into the report as the X-axis of my graphs.

 

So, if my date slicer shows May-19, I would like the list of months to be from May-19 -> 13 months back to May-18

We don't want to have to pick all the months from the list, nor use the relative date slicer provided by PBI as the business want to have all of the graphs filtering on the same slicer.

I have at my disposal a full data warehouse Kimball style with a complete Date table and the Tabular model is the same. 

List of monthsList of months

 

Thanks in advance!

Basia

2 REPLIES 2
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous ,

 

You need a calendar table which is unlinked to fact table.

Date = FILTER(CALENDAR(DATE(2018,1,1),DATE(2019,12,31)),DAY([Date])=1)

Create below measures. Add measure [check] into visual level filter, and set its value to 1.

Rank in calendar = RANKX(ALL('Date'),CALCULATE(MAX('Date'[Date])),,ASC,Dense)
Rank = RANKX(ALLSELECTED(Sample1),CALCULATE(MAX(Sample1[Date])),,ASC,Dense)
check = IF([Rank]>[Rank in calendar]-13&&[Rank]<=[Rank in calendar],1,0)

1.PNG

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-yulgu-msft ,

 

Thank you very much for helping me with this. 

Can you please clarify if the Date list on the left in your screenshot is from the existing Date Table with a join to fact or is it a list from the Unlinked Date table?

Also, in your test model, what is the lowest grain of the new unlinked date table? Is it Day or Month?

I'm giving this a go in SSAS, so far not much luck.

 

Thanks again,

Basia

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.