Forum Discussion
pbeeyeqs
Helper I
6 years agoCurrent Month, Previous Months Counts Now Not Working
I can only assume this stopped working now that we are into a new year. It no longer calculates PREVIOUS MONTH, 2 MONTHS AGO, 3 MONTHS AGO, ... It does calculate TOTAL COUNT THIS MONTH: Total C...
- 6 years ago
Hi pbeeyeqs ,
quick and dirty.
Total Count Last Month =COUNTX(FILTER('_Report_All Logins',MONTH([Activity_Date])= IF(MONTH(TODAY()) = 1, 12, MONTH(TODAY()) -1)),'_Report_All Logins'[dbo_USER_ACTIVITY_ID])Regards,
Marcus
Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support. - 6 years ago
Hi pbeeyeqs ,
another dirty hack..
Total Count Last Month = COUNTX( FILTER( '_Report_All Logins', MONTH(DATEADD([Activity_Date],1, MONTH))=MONTH(TODAY()) ), '_Report_All Logins'[dbo_USER_ACTIVITY_ID] )Total Count 2 Months Ago = COUNTX( FILTER( '_Report_All Logins', MONTH(DATEADD([Activity_Date],2, MONTH))= MONTH(TODAY()) ), '_Report_All Logins'[dbo_USER_ACTIVITY_ID] )
mwegener
Most Valuable Professional
6 years agoHi pbeeyeqs ,
quick and dirty.
Total Count Last Month =
COUNTX(
FILTER(
'_Report_All Logins',
MONTH([Activity_Date])= IF(MONTH(TODAY()) = 1, 12, MONTH(TODAY()) -1)
),
'_Report_All Logins'[dbo_USER_ACTIVITY_ID]
)
Regards,
Marcus
Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.
Marcus
Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.
pbeeyeqs
Helper I
6 years agoThat seems to work for previous month. How would it then figure 2 months ago, 3 months ago, ...
I have below for 2 months ago, but it doesn't seem to be correct:
Total Count 2 Months Ago =
COUNTX(
FILTER(
'_Report_All Logins',
MONTH([Activity_Date])= IF(MONTH(TODAY()) = 1, 12, MONTH(TODAY()) -2)
),
'_Report_All Logins'[dbo_USER_ACTIVITY_ID]
)
- mwegener6 years ago
Most Valuable Professional
Hi pbeeyeqs ,
another dirty hack..
Total Count Last Month = COUNTX( FILTER( '_Report_All Logins', MONTH(DATEADD([Activity_Date],1, MONTH))=MONTH(TODAY()) ), '_Report_All Logins'[dbo_USER_ACTIVITY_ID] )Total Count 2 Months Ago = COUNTX( FILTER( '_Report_All Logins', MONTH(DATEADD([Activity_Date],2, MONTH))= MONTH(TODAY()) ), '_Report_All Logins'[dbo_USER_ACTIVITY_ID] )