May 27 2020 05:56 PM
Hi guys! Need your help. I'm struggling to formulate the % change in D A X. I'm trying to have a measure for Daily, Week of the year, Monthly, Quarterly and yearly for comparative purposes. This is my data.
My first option is to get the previous value for daily to get the %daily change. This is my formula,
for
Sales= Sum([ ])
then
for
Previous Sales = CALCULATE([Sales],DATE ADD('Calendar'[DATE],-1,DAY))
Take note of the fact date and Calendar date,they are different because "Date add" don't usually work in fact date or non continuous that's why I created Calendar table(continuous)
This is the outlook. It did not met what I want. The Blank cells are not part of Fact Date.
How Can I remove those blanks? or Should I change my formula? My data sets? Please need your help!!!
Thank you!
May 28 2020 05:05 AM
Depends on goals. If there were no sales on previous date and blank is returned, that's correct.
If compare to the latest date before current when sales were, you may filter on max date in fact table before current date in calendar table.
If compare to the same date in previous month that will be another measure, etc. Period comparasion patterns are here https://www.daxpatterns.com/time-patterns/