Hi Dhruvin
I want the DAX for calculating previous month sales in sales fact table without date column and having only year and month column in the table
Also it should handle if month is 1 then previous month: 12 and not 0
Regards
Arun
Hi Dhruvin
I want the DAX for calculating previous month sales in sales fact table without date column and having only year and month column in the table
Also it should handle if month is 1 then previous month: 12 and not 0
Regards
Arun
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Amira BedhiafiPosted Sep 29, 2025, 1:34 PM
Hello Dhruvin !
I would recommend that you add a proper date column in your case, meanwhile you need to capture the selected year or month context from your table or slicer and if
month= 1, you go toDecemberof the previous year otherwise, you just subtract 1 from the current month.If you need a running trend across monthsit’s better to create a YearMonth key (like
202501) and calculate relative offsets usingMAX orMINor a proper date table.