Forum Discussion
Jaromir
9 years agoFrequent Visitor
Visualization: stock differences between days
Hi there, I have a database with products (quantity in stock) and their changes in time and I need a graph with differences between days. The table can look like this: I don't know how to...
- 9 years ago
Hi Jaromir,
You could create calculated measure for "Total sales to previous date":
Prev Sales = CALCULATE(SUM(Sales[Sales]),PREVIOUSDAY(Sales[Date]))
Create calculated measure for stock differences between days:
stock differences between days = sum(Sales[Sales])- [Prev Sales]
If this works for you please accept it as solution and also like to give KUDOS.
Best regards
Tri Nguyen
Jaromir
9 years agoFrequent Visitor
Hi tringuyenminh92,
thanks for your response. I have created a calculated measure as you suggested:
PrevStock = CALCULATE(SUM('data'[stock]); PREVIOUSDAY('data'[date]))But it only returns empty field. I have checked and there is a row with a previous day date. What could I be doing wrong?
Thanks again.
Jaromir
9 years agoFrequent Visitor
I found the problem, had to use PREVIOUSDAY('data'[date].[Date]).