YTD Calculation-ask.qvw



    I am trying to calculate ‘previous month spending’ using set analysis. I have used the expression =sum({<Month_Num = {$(vPrevM)}>}Spending), where vPrevM =max(Month(Date)-1) , but this expression does not bring the result correctly. I have used similar expression in calculating ‘previous year spending’ and that’s working fine.


    Please find the dataset and app attached.


    Could you please help me why I am not able to calculate previous month spending.