Posts: 105
Registered: ‎05-25-2016

Previous Month before current month

Hi, everybody


I need a phormula that calculates a value of the previous month before the current one.


I don't want to use slicers to select the month. There has to be something 'invisible' for end user.


I have tried this:  REVPAR previous month = CALCULATE(SUM('REVPAR/REVPAG'[Amount)/SUM('REVPAR/REVPAG'[Capacity]);FILTER(DimDate;DimDate[Month]=MONTH(TODAY())-1);FILTER(DimDate;DimDate[Year]=YEAR(TODAY())))


As you can see, it doesn't work because current month is Jan-2017 and the phormula refers to Dic-2017. 


Any tip?.


Thanks in advance,


New Contributor
Posts: 563
Registered: ‎02-17-2016

Re: Previous Month before current month

Hi @Angel


Try using PREVIOUSMONTH function.





Posts: 105
Registered: ‎05-25-2016

Re: Previous Month before current month

Hi, @CheenuSing


I think if I use PreviusMonth i must select a month in slicer. This is not the thing I want to do.


I want to show previousmonth before current without select month in a slicer.


It must be dynamicilly,  without user interaction.


Anyway, I have created a boolean column that indicates if sales date is in the previusmonth.


If I filter by true, It works.


Thanks, anyway