Forum Discussion
Compare previous month data to current month
You will want to write a measure that gets the value you are showing (SERIAL NUMBER) but for the previous month.
Something like this:
PrevMonth = CALCULATE( COUNTA( Table[Serial Number] ), PARALLELPERIOD( Table[Date], -1, MONTH) )
I tried this measure but receive an error when i put it into the target goal position. I changed the Table assignments to match my data (Table1[SERIAL_NUMBER]) for instance. I get the following error:
The Month value that i am working with is just a number representation (1 for January, 2 for February, etc) that I manually add to my spreadsheet. There is no unique key in my data that can identify when i exported it, that is why i manuall fill in. Should this be a full date format?
Thank you for your assistance.
- dedelman_clng9 years ago
Community Champion
Yes you should be using a Date type field to use PARALLELPERIOD. You could continue to use integers, but then you will want to add a year column in addition to the month column to account for what you want to show when it is January. That way is more complicated (lots of IF), so making the Month value be a Date that is the first day of the month is going to be your easiest path.
Hope this helps
David
- v-huizhn-msft9 years ago
Microsoft Employee
Hi Saw_Dusted
Have you resolved your issue? If you have, please mark corresponding reply as answer, and welcome to share your own solution. more people will benefit from it.
Best Regards,
Angelia