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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
GoingIncognito
Advocate III
Advocate III

Best practice using time intelligence on a table without continous dates?

Hi.

 

What would be the best practice of using time intelligence on a fact table that doesn't have continous dates? I need to count the difference of max interest of the last and penultimate month in the fact table. So like: max interest of last month - max interest of the month before? I do have a calendar table, but last date of calendar date can be later than than the fact tables last date.

 

I assume I could do something like date( year(fact_tables_column), month(fact_tables_column) -1, date(fact_tables_column))

but better version could be something along the lines of maxx(fact_table, calculate(max(interest), dateadd(calendar_table, -1, month))) ?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

Best is to have a calendar table.

you formula would look like

calculate(max(table[intRate]),filter(date,date[date]=max(fact[date])))
last month would be bit tricky
calculate(max(table[intRate]),filter(date,date[date]<=maxx(fact,dateadd(fact[date],-1,month))))
or
calculate(max(table[intRate]),filter(date,dateadd(date[date],-1,month)=max(fact[date])))

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s.

Refer
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi

https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

Best is to have a calendar table.

you formula would look like

calculate(max(table[intRate]),filter(date,date[date]=max(fact[date])))
last month would be bit tricky
calculate(max(table[intRate]),filter(date,date[date]<=maxx(fact,dateadd(fact[date],-1,month))))
or
calculate(max(table[intRate]),filter(date,dateadd(date[date],-1,month)=max(fact[date])))

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s.

Refer
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi

https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.

Top Solution Authors