PDA

View Full Version : Counting values in previous period(s) DAX



DaveConva
2016-05-31, 04:08 AM
Hi.

I have one column named Month Tagged which contains dates from TODAY all the way back to 2012. I have 100K of lines of data with a Month Tagged field on every line.

I do reporting every month for the previous 11 months.

All I want to do is a calculated measure that counts the amount of times each month occurs in the previous 11 months.
dax
So for May 2016 reporting I will want to cont how many time each Month Tagged occur from June 2015 to April 2016.

Any help would be appreciated

Ken Puls
2016-05-31, 10:49 PM
How do you tell the system you're working on May 2016? Do you have a timeline/slicer hooked up to a specific field?

The Month Tagged... is this is date, or just a number? Can you post a five line sample of that that table looks like?

DaveConva
2016-06-03, 12:11 AM
Currentley I use the below excel formula to tell it the current month and then -1 =TEXT(EOMONTH(TODAY(),-1),"MMMM")

No I have no timeline or slicer hooked up

Month Tagged is in the format 05/2016, 04/2016 etc.... or if i do a FORMAT calculated column I can get it to look like May-16, Apr-16 etc.....

Example Data:



[Month Tagged]


01/2016


01/2016


01/2016


04/2016


04/2016


04/2016


04/2016


04/2016


04/2016


10/2015


10/2015


10/2015


10/2015


10/2015


11/2015


11/2015


11/2015


11/2015


12/2015


12/2015


12/2015


12/2015