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 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.