Forum Discussion
Turnovers formulas
Hi niksdu ,
The error is because of the parenteses the formula need to be:
2022yesterdayturnover =
CALCULATE (
SUM ( Query1[turnover] ),
DATE ( YEAR ( NOW () ) - 1, MONTH ( NOW () ), DAY ( NOW () - 1 ) )
)
However looking at your formula this will not give you the previous day metric because when you change month it will not return the correct value try the following:
2022yesterdayturnover =
var PreviousDayValue = TODAY() -1
Return
CALCULATE (
SUM ( Query1[turnover] ),
Table[Date]= DATE(YEAR(PreviousDayValue)-1, MONTH(PreviousDayValue), DAY(PreviousDayValue) ))
)
Thank you for your solution.
The formula is working, however the numbers doesn't match with the numbers on database.
Also, I haven't figured out correct formulas for yesterday 2021 turnover, last month 2021 turnover and last month 2022 turnover.
For now, I have formulas like this-
Yesterday 2021 turnover:
- MFelix4 years ago
Super User
Hi niksdu .
Without any data is difficult to give you a best answer, I just did the metrics based on the ones you already provided.
Can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.
If the information is sensitive please share it trough private message.