Dax help for CACULATE selected date -7

shophoney

Active Member
Joined
Jun 16, 2014
Messages
281
Hi I have a calendar table with a column that shows the monday of the week. And I need to calculate the sales, receivings and on hand for each week.

So what I thought was take the selected week starting on a monday. And subtract all sales and receivings since then.

my dCalendar has a monday start of the week column. But my formula below doesnt work. It just says error.

1WK AGO RECEIVED:=CALCULATE('tblInvSkuMaster'[RECEIVED TOTAL UNITS],DATESBETWEEN(dCalendar[WEEKS-MON],dCalendar[WEEKS-MON]-7))


This formula works but calculates all values as of today to show what our position was 7 days ago.
UNITS RECEIVED 1WK AGO:=CALCULATE('tblInvSkuMaster'[RECEIVED TOTAL UNITS],DATESBETWEEN(dCalendar[DATES],TODAY()-7,TODAY()))

Thanks
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Couple of things. All three dates in DATESBETWEEN must be type Date. First parameter is a reference to a date/time Column, next 2 parameters must by Date values.

So I'm assuming the column WEEKS-MON are not a date values? and to since the 2nd and 3rd parameters need to be date values, you have to use something like MAX ( dCalendar[Date] ).
 
Upvote 0
Hi, thanks for the reply.

I have added a column in dCalendar that has the Monday-Week that is selected -7. So that is i have another column that is the date of 1 week ago from whatever week is selected.

I need to figure out how to create a formula that shows my OH at a point in time. Based on the week selected.

It will take todays OH, + units sold from selected date to today + units transfer out - units deleivered.

Thanks
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,603
Members
449,038
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top