Forum Discussion

pmadam's avatar
pmadam
Helper II
6 years ago
Solved

DAX HELP

I want to create Previous month sales measure. so i created Latest month and previous month measures.

But when i create final measure to calculate sales for Previous month i get blank values

 

Below are the measures

 

LATESTMONTH = CALCULATE(MAX('Time'[Month Num]),'Time'[CurrMonthFlag] = "Y")
ans)8
 
 
Previous Month = latestmonth -1 
ans)7
 
PM Ship Order Count =
CALCULATE([Ship Order Count],FILTER('Time', 'Time'[Month Num] = [PreviousMonth]))
 
 
 
Please help.
Prathy
 
 
  • Hi pmadam ,

     

    Would you please change your two measure to:

     

    LATESTMONTH = CALCULATE(MAX('Time'[Month Num]),ALL('Time'),'Time'[CurrMonthFlag] = "Y")
    PM Ship Order Count =
    CALCULATE([Ship Order Count],FILTER(ALL('Time'), 'Time'[Month Num] = [PreviousMonth]))

     

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    Best Regards,

    Dedmon Dai

3 Replies