Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

DATEADD function

Hello, I'm having an issue calculating a total. Here is what I'm trying to do. In the end I'm trying to calculate the total for the prior day. If the prior day happens to fall on Sunday, then take the day before that. I haven't even got that far. First I was trying to get accurate results for the prior day. Since today is 8/3/2020, prior day date is 8/2/2020. However, you will see in my screenshot below I'm getting odd results. I have scripted out the measures used and what I'm getting in a matrix. Can someone explain what is happening here? For both these measure I'm expecting to see 8/2/2020 in the row for the date and blank for the total since I only have 46 records back on the 31st of July. Also, how would I create my measure to account for going back an additional day if the previous day is Sunday? 

 

 

Thanks in advance! 

3 Replies