Hi all, I am new to using the forum - I hope this is the correct format and place for this question.
I have data similar to this (this is simplified for the example):
Date State A B
02/08/2020 VIC 2 4
02/08/2020 NSW 3 5
02/08/2020 WA 3 6
03/08/2020 VIC 6 3
03/08/2020 NSW 1 1
03/08/2020 WA 4 3
04/08/2020 VIC 3 6
04/08/2020 NSW 7 7
04/08/2020 WA 2 4
I would like to be able to filter the data by individual State or All for reporting and to have measures for the previous day to produce tables (and later graphics) similar to those below:
Filter: ALL
Date A B Previous day A Previous day B
02/08/2020 8 15
03/08/2020 11 7 8 15
04/08/2020 12 17 11 7
Filter: VIC
Date A B Previous day A Previous day B
02/08/2020 2 4
03/08/2020 6 3 2 4
04/08/2020 3 6 6 3
Currently everything that I have tried produces nothing for the Previous A and Previous B columns.
Can this be done? Your help would be greatly welcomed.
Hi @simonbb, I hope that you are having a great experience using the Support Forum so far. We’ve recently launched the Enterprise DNA Forum User Experience Survey, please feel free to answer it and give your insights on how we can further improve the Support forum. Thanks!
Thanks you for your welcome and your proposed solution. It did not quite address my problem but it did lead me to finding the solution that I required. What you solution has done has identified ares of DAX that I need to work on.
The issue I had that caused my measure not to work was I had:
Prev value =
CALCULATE( [Value], PREVIOUSDAY( Dates[Date].[Date]))
Once I removed the .[Date] if addressed my problem. I was close
You get that .[Date] because of the enabled auto date time feature. I can’t emphasize enough to always include a proper Date dimension table when you have a date field anywhere in your model and mark it as such. And to disable the auto date time feature globally in the Power BI settings.