Forum Discussion
Problem with Time Intelligence functions
- Anonymous9 years ago
Thanks for your suggestion v-sihou-msft.
I was looking for a solution and I found this article that gave me the way.
http://www.sqlbi.com/articles/week-based-time-intelligence-in-dax/
Anonymous
The DATEADD() function only works for contiguous date selection, which means you need to select contiguous dates into your table visual. In this scenario, you can create a calculated column instead of a measure to workaround this issue.
For PREVIOUSMONTH() function, it should work once you create a relationship between your fact table and the full calendar table.
See my sample below:
Previous Month = CALCULATE(SUM('Fact'[Amount]),PREVIOUSMONTH('Calendar'[Date]))
Last Week Column = CALCULATE(SUM('Fact'[Amount]),DATEADD('Calendar'[Date],-7,DAY))
Regards,
Thanks for your suggestion v-sihou-msft.
I was looking for a solution and I found this article that gave me the way.
http://www.sqlbi.com/articles/week-based-time-intelligence-in-dax/