Forum Discussion
Joey2022
4 years agoRegular Visitor
Calculated column to show difference value btw rows
Hi there! I need a favor from you guys, experts. I stucked in the matter for weeks. Pls kindly help me out. The matter is: I want to find the difference value of sale btw 2 days as: Date Sal...
- 4 years ago
Hi,
Try this
- Create a Calendar Table and build a relationship from the Date column of your Data Table to the Date column of the Calendar Table
- To your visual, drag Date from the Calendar Table.
- Write these measures:
Sales = sum(Data[SaleAmount])
Previous day sales = calculate([Sales],previousday(Calendar[Date]))
Delta = [Sales]-[Previous day sales]
Hope this helps.
- 4 years ago
Joey2022
4 years agoRegular Visitor
hi Ashish_Mathur,
I still have a issue regarding to the day without data e.g Sunday. I want to find the different btw Monday and last Saturday. So the "previousday" don't work properly in the case.
Thank you
Joey
Ashish_Mathur
4 years agoSuper User
- Joey20224 years agoRegular Visitor
Hi Ashish Mathur,
Thank you for working it out. I still digest your DAX code, not really understand about how to calculate the Previous day and the Sales in the day.
I am trying with my data. It's like a blind puzzle haha doesn't work out as expected.
Joey
- Ashish_Mathur4 years agoSuper User
You are welcome. If my previous reply helped, please mark it as Answer.