Forum Discussion
How to Calculate Total Sales for Specific Date
- 4 years ago
ADSL the relationship between date table and order table is on the month column which is always showing the 1st day of the month, first you need to change that relationship and also update the measure as shown below
Total Sales Day 01 - 25 = SUMX ( VALUES ( 'Date'[MonthnYear] ), VAR __date = CALCULATE ( MAX ( 'Date'[Date] ) ) VAR __startDate = EOMONTH ( __date, -1 ) + 1 VAR __endDate = DATE ( YEAR ( __date ), MONTH ( __date ), 25 ) RETURN CALCULATE ( SUM('Order'[Amount No VAT]), DATESBETWEEN ( 'Date'[Date], __startDate, __endDate ) ) )✨ Follow us on LinkedIn and to our YouTube channel
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.
ADSL you can try something like this
Total Sales =
VAR __date = MAX ( 'Calendar'[Date] )
VAR __startDate = EOMONTH ( __date, -1 ) + 1
VAR __endDate = DATE ( YEAR ( __date ), MONTH ( __date ), 25 )
RETURN
CALCULATE (
SUM ( Table[Sales] ),
DATESBETWEEN ( 'Calendar'[Date], __startDate, __endDate )
)
✨ Follow us on LinkedIn and to our YouTube channel
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.
- ADSL4 years ago
Post Prodigy
Hi parry2k,
Thank you for your feedback.
But after trying your measure, it seem not working. Please kindly assist to check the screenshot or access to file that I create - https://drive.google.com/file/d/1qi5o6KhV9KpqSQP07dr6xfFJlGnzcfPH/view?usp=sharing