Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 216047

DAX Relative Business Day Offset Formula help

$
0
0

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: 

 

DayDateBusiness Day FlagMax Inv DateRelative Offset Calendar DaysRelative Offset Business Days (desired)
Thursday9/8/201619/12/2016-4-2
Friday9/9/201619/12/2016-3-1
Saturday9/10/201609/12/2016-20
Sunday9/11/201609/12/2016-10
Monday9/12/201619/12/201600
Tuesday9/13/201619/12/201611

 

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. 


Viewing all articles
Browse latest Browse all 216047

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>