Forum Discussion

Iamnvt's avatar
Iamnvt
Continued Contributor
8 years ago
Solved

Sales - stock Calculation

hi,

 

I have a Sales table:

Order      Date               Product  Sales

111/25/2017A10
211/26/2017B20
311/27/2017A5

 

and a Stock table:

Product    Quantity

A1
B2

 

How can I make a DAX measure to calculate the Material Requirement for each date?

Eg. 

Date                Product   Requirement

11/25/2017A9
11/26/2017B18
11/27/2017A5

 

the tricky part is that the stock table does not have date column, meanwhile the Sales table has the Date column.

 

sample file is here:

https://1drv.ms/x/s!Aps8poidQa5zkvFwWm3YbzFb15bkTw

 

thanks

8 Replies

  • Hi Iamnvt, if you begin by creating a measure that sums the total product sales for each product before the current date, then you will quickly arrive at a simple formula for Material Requirement.

    • Iamnvt's avatar
      Iamnvt
      Continued Contributor
      Hi,

      It is not working when you put the date field into the pivot.

      Br
      • DAX0110's avatar
        DAX0110
        Resolver V

        Hi Iamnvt, can you upload the sample file elsewhere?  I can't download it from the current host.