Forum Discussion
dilbagsidhu
2 years agoFrequent Visitor
month to month calculation
hello fellows, im trying to calculate Month to month expenses change in my dataset, which inculdes one whole year data of expenses for different categories on different dates. i tried finding...
xifeng_L
Super User
2 years agoHi dilbagsidhu
It looks like you are using the fact table in the PREVIOUSMONTH function? And it should be the same table as the slicer, right?
Since the slicer selects May, then the PREVIOUSMONTH function returns the date of the previous month, but since the slicer restricts the month to May, the intersection of the two will be null, leading to a null final result.
You should create a date table and use the dates from the date table in the PREVIOUSMONTH function. But if you want to keep using the fact table that's fine, just remove the month filter of slicer. You can try below measure.
Previous month =
CALCULATE (
[Total],
PREVIOUSMONTH ( '2024'[Date] ),
ALL ( '2024'[Month Field of Slicer] )
)
Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~