Forum Discussion
Incorrect Previous month value calculation
- 5 years ago
Hi Uzi2019 ,
Did you create a relationship between the two tables?
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 5 years ago
Hi Syndicate_Admin ,
I create the following sample data, and then create a measure.
Ventas anteriores = var MonthEnd = CALCULATE( SUM('DataTable'[Sales]), DATEADD( 'Calendar'[Date], -1, MONTH ) ) var Month = CALCULATE( SUM('DataTable'[Sales]), FILTER( ALL('DataTable'), 'DataTable'[Date] <= EDATE( MAX('Calendar'[Date]), -1 ) &&'DataTable'[Date] >= EDATE( MIN('Calendar'[Date]), -1 ) ) ) var Result = IF( MAX('Calendar'[Date]) = EOMONTH( MAX('Calendar'[Date]), 0 ), MonthEnd, Month ) return ResultIf the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, Uzi2019
If it is OK with you, please share your sample pbix file, then I can try to look into it and come up with a fixed result.
Thank you.
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
- Uzi20195 years agoCommunity Champion
Thank you for reply. But cant share you pbix file for security reasons.