Forum Discussion
Best practice using time intelligence on a table without continous dates?
- 6 years ago
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
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