Forum Discussion
monojchakrab
4 years agoResolver III
Last month same period not computing correctly
Hiya all, I am trying to compute the current month MTD sales and compare the same with the previous month same period. The code for both are as below : 1. MTD : MTD sales =
CALCULATE(
...
- Anonymous4 years ago
Hi monojchakrab ,
You can refer the following links to get the same period sales of last month:
1-MonthSamePeriod = CALCULATE ( SUM ( 'Table'[Sales] ), FILTER ( 'Table', AND ( [Date] >= DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ) - 1, 1 ), [Date] <= DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ) - 1, DAY ( TODAY () ) - 1 ) ) ) )Prev MTD = CALCULATE ( SUM ( Sales[Sales_Amount] ), FILTER ( ALL ( Sales[Sale_Date] ), Sales[Sale_Date] >= DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ) - 1, 1 ) && Sales[Sale_Date] <= TODAY () ) )How to compare SAME PERIOD LAST MONTH in Power BI using DAX
Best Regards
monojchakrab
4 years agoResolver III
SpartaBI ,
My dates are all from a separate date table...this is not the problem as otherwise MTD and DATESMTD would not be returning the correct table/results
We can definitely have a zoom call when convenient for you. I am in India so you can check out the time difference with your location.
mateustosatti
1 year agoNew Member
Hi! Could you please help me? I'm having the same problem and have already tried everything!