Forum Discussion
Measure for average price
Hello,
I have a table with amount and quantity per location, per product, etc.
What is the best measure to calculate the average price.
At this moment i have the following:
Hi marsclone ,
Do you want to get the output below?
If it is, you could create the measure below.
difference price = VAR average_price_2017 = CALCULATE ( [Average Price], FILTER ( 'Date', 'Date'[Year] = 2017 ) ) VAR average_price_2018 = CALCULATE ( [Average Price], FILTER ( 'Date', 'Date'[Year] = 2018 ) ) RETURN average_price_2018 - average_price_2017If you still need help, please share your desired output.
In addition, please mask sensitive data before uploading.
Best Regards,
Cherry
2 Replies
- v-piga-msftResident Rockstar
Hi marsclone ,
Do you want to get the output below?
If it is, you could create the measure below.
difference price = VAR average_price_2017 = CALCULATE ( [Average Price], FILTER ( 'Date', 'Date'[Year] = 2017 ) ) VAR average_price_2018 = CALCULATE ( [Average Price], FILTER ( 'Date', 'Date'[Year] = 2018 ) ) RETURN average_price_2018 - average_price_2017If you still need help, please share your desired output.
In addition, please mask sensitive data before uploading.
Best Regards,
Cherry
- marscloneHelper IV
Hello Cherry,
Thank you for your help! This will work!
Is this a better solution instead of measures calculating (Amount YTD & Quantity YTD) and (Amount LY & Quantity LY) and divide those and substract?
Regards Marcel