Forum Discussion

H20treddr's avatar
H20treddr
Frequent Visitor
7 years ago

Quarter beginning Inventory

I am trying to measure beginning inventory for a Month or Quarter.  The difficulty is that in any given week I do not necessarilly have data (see table) so I woud like to summ across the "first reported" week.  Is there a way to do this with measures and/or DAX?  THANKS

 

  qtr 1qtr 1qtr 1qtr 1qtr 1
customer nameSKUweek 1week 2week 3week 4week 5
Customer 1SKU 11   1
 SKU 21    
 SKU 31    
 SKU 41    
Customer 2SKU1 111 
Customer 3SKU1   1 
 SKU 1   1 
 SKU 2   1 
 SKU 3   1 
Customer 4SKU 1     
Customer 5SKU 2 1 11
Customer 6SKU 31    
Customer 7SKU 3  11 
Customer 8SKU 2111  
Customer 9SKU 1     
Customer 10SKU 1 1111
       
Beginning Value for qtr 1 = Sum of red = 14      

3 Replies

  • Do You have some Sample data.

     

    I have done this before the idea is to Calculate toe sum or values for each week, find the first week and return this value. these two parts are relativly simple but it is dependent on how your data is structured in the data table.

    for example if you have two colunms of Week and Qrt in your table then this complicates things as you cannot use time based functions. 

     

    please add a sample data set and i can take a look for you.

    • H20treddr's avatar
      H20treddr
      Frequent Visitor

      Thanks Anthony - we are the more complicated :) ... here is some sample data:

       

      RegionReporting CustomerProduct SKUYearWeek NumberMonth NumberQtr NumberSales Quantity
      Region ACustomer 1SKU 120185012442
      Region ACustomer 1SKU 12018511242
      Region ACustomer 1SKU 22018511241
      Region ACustomer 1SKU 1201921142
      Region ACustomer 1SKU 1201931141
      Region ACustomer 2SKU 120194111
      Region ACustomer 1SKU 1201941141
      Region ACustomer 1SKU 120195111
      Region ACustomer 1SKU 2201952140
      Region ACustomer 2SKU 120195114
      Region ACustomer 3SKU 320196211
      Region ACustomer 1SKU 1201962140
      Region ACustomer 1SKU 1201972140
      Region ACustomer 2SKU 120197214
      Region ACustomer 1SKU 1201982140
      Region ACustomer 2SKU 120198218
      Region ACustomer 3SKU 320199211
      Region ACustomer 1SKU 1201993140
      Region ACustomer 2SKU 120199213
      Region BCustomer 4SKU 120199211
      Region ACustomer 1SKU 12019103140
      Region BCustomer 4SKU 1201910311
      Region ACustomer 1SKU 12019113140
      Region ACustomer 2SKU 1201911313
      Region BCustomer 4SKU 1201911311