Forum Discussion
Count previous months
- 7 months ago
Hi Dicken
Can you please try this measure
Count Previous Months=
CALCULATE(DISTINCTCOUNT('Calendar'[Month Number]),FILTER(ALL('Calendar'),
'Calendar'[Date]<=MAX('Calendar'[Date])),
KEEPFILTERS('Sales')) - 7 months ago
hi Dicken ,
try like:
Count Previous Months:=
VAR Myear =
IF(
HASONEVALUE( 'Calendar'[Year]),
VALUES( 'Calendar'[Year])
)
VAR Mmonth =
IF (HASONEVALUE( 'Calendar'[Month Number]), VALUES('Calendar'[Month Number]))
RETURN
CALCULATE (
COUNTROWS ( 'sales'),
FILTER(ALL('Calendar'), 'Calendar'[Month Number]<= Mmonth && 'Calendar'[Year] = Myear))
- 7 months ago
Thank you all, I'll work through all of them.
Hi Dicken
Can you please try this measure
Count Previous Months=
CALCULATE(DISTINCTCOUNT('Calendar'[Month Number]),FILTER(ALL('Calendar'),
'Calendar'[Date]<=MAX('Calendar'[Date])),
KEEPFILTERS('Sales'))
Thank you all, I'll work through all of them.