Hi Everyone,
I'm new to DAX and having trouble trying to create a calculated field in my SSAS tabular model. I have data that looks like this:
Day | Date | Business Day Flag | Max Inv Date | Relative Offset Calendar Days | Relative Offset Business Days (desired) |
Thursday | 9/8/2016 | 1 | 9/12/2016 | -4 | -2 |
Friday | 9/9/2016 | 1 | 9/12/2016 | -3 | -1 |
Saturday | 9/10/2016 | 0 | 9/12/2016 | -2 | 0 |
Sunday | 9/11/2016 | 0 | 9/12/2016 | -1 | 0 |
Monday | 9/12/2016 | 1 | 9/12/2016 | 0 | 0 |
Tuesday | 9/13/2016 | 1 | 9/12/2016 | 1 | 1 |
The calulated field i'm trying to create is in BOLD on the far right.
You can see i am trying to create a dynamic relative off set, but not include weekends like the "Relative Offset Calendar Days" column is doing.
So basically "Today" is 9/12/16 and i want to be able to select 0,-1,-2 (the last 3 business days) in this new column for this scenario, and it brings back Thursday 9/8 & Friday 9/9 & Monday 9/12. Some people might want the last 4, 5, 10, etc. business days.
The next day will be 9/13/16 Max Invoice Date, and those relative offsets will be re-built appropriately.
I think it's involves Calculate and EARLIER functions but i'm not even sure of that.
Thanks for any help anyone can provide.