Forum Discussion
rcb0325
Helper I
2 years agoIssue with connecting an external source with previous year's info!
I am trying to calculate previous year's sales from an external source, and show it as a 'last year to date' calculation. The main dataset holds this years sales info, and I have a [Sales Amount...
- Anonymous2 years ago
Hi rcb0325 ,
Can you provide the DAX you used for your calculations?
Without data and DAX, for the problem you are facing, I can only suggest you to use this filter condition in DAX when calculating the sum of the corresponding time period last year:YEAR('DATE'[Date]) = YEAR(SELECTEDVALUE('DATE'[Date]) - 1 && MONTH('DATE'[Date]) = MONTH(SELECTEDVALUE('DATE'[Date]) && DAY('DATE'[Date]) = DAY(SELECTEDVALUE('DATE'[Date])
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
rcb0325
Helper I
2 years agoAnonymous , I misread your formula. It appears to be working this way!
Sales_Amount_LYTD =
CALCULATE( SUM( 'Mfg Rep Sales'[Invoiced Amount]),
YEAR('Mfg Rep Sales'[Invoice Date]) = YEAR(SELECTEDVALUE('dim PostingDate'[PostingDateDate])) -1 && MONTH('Mfg Rep Sales'[Invoice Date]) = MONTH(SELECTEDVALUE('dim PostingDate'[PostingDateDate])) && DAY('Mfg Rep Sales'[Invoice Date]) = DAY(SELECTEDVALUE('dim PostingDate'[PostingDateDate]))
)
Thank you for your help.