Hello,
I receive daily sales data from a retail store for products and units sold in a 'Sales product table'.
I am trying to determine the total value using a calculated column (if this could be done with a measure I am interested in hearing this solution)
The total value should be straight forward as I have the value of the product in the product description. So it is simply the value of the product * units sold.
Except I have products that have a variable value. This is where I am lost.
The value of the variable products is located in another table- 'Variable product table'. I am trying to bring the total value by day for variable into the Sales product table. My end result would look like 'End result table'
I had a solution where I concatenated storeid and date to create a relationship between the tables and used a switch function to work out the value, but I am dealing with millions of rows. This took up a lot of space and was not feasible for publishing.
Thank you for any assistance.
Sales product table | |||
StoreID | Product | Units Sold | Date |
1 | $100 Product | 2 | 1/1/2016 |
1 | $200 Product | 1 | 1/1/2016 |
1 | $300 Product | 4 | 1/1/2016 |
1 | Variable Product | 3 | 1/1/2016 |
Variable product table | ||||
StoreID | Product | Units Sold | Sales Value | Date |
1 | Variable Product | 1 | 115 | 1/1/2016 |
1 | Variable Product | 1 | 187 | 1/1/2016 |
1 | Variable Product | 1 | 500 | 1/1/2016 |
End result table | |||||
StoreID | Product | Units Sold | Date | Sales Value | Comment |
1 | $100 Product | 2 | 1/1/2016 | $200 | $100 product * 2 Units sold |
1 | $200 Product | 1 | 1/1/2016 | $200 | $200 product * 1 Units sold |
1 | $300 Product | 4 | 1/1/2016 | $1,200 | $300 product * 4 Units sold |
1 | Variable Product | 3 | 1/1/2016 | $802 | Sum of sales value column from 'Variable product table' for 1/1/2016 and StoreID1 |