Forum Discussion
blindeye
Advocate II
8 years agoIdentify dates in the last/previous month
I'm trying to create a column that will identify a date that is in the month prior to the current month. I have a calculated column that returns a "Yes" if the date is in the current month as fol...
- 8 years ago
Hi blindeye,
Please try this measure:
Count Dates = IF ( MONTH ( TODAY () ) = 1, CALCULATE ( COUNT ( 'Ops Data'[Closed Date] ), FILTER ( 'Ops Data', 'Ops Data'[Closed Date].[Year] = YEAR ( TODAY () ) - 1 && 'Ops Data'[Closed Date].[MonthNo] = 12 ) ), CALCULATE ( COUNT ( 'Ops Data'[Closed Date] ), FILTER ( 'Ops Data', 'Ops Data'[Closed Date].[Year] = YEAR ( TODAY () ) && 'Ops Data'[Closed Date].[MonthNo] = MONTH ( TODAY () ) - 1 ) ) )Best regards,
Yuliana Gu
v-yulgu-msft
Microsoft Employee
8 years agoHi blindeye,
Please try this measure:
Count Dates =
IF (
MONTH ( TODAY () ) = 1,
CALCULATE (
COUNT ( 'Ops Data'[Closed Date] ),
FILTER (
'Ops Data',
'Ops Data'[Closed Date].[Year]
= YEAR ( TODAY () ) - 1
&& 'Ops Data'[Closed Date].[MonthNo] = 12
)
),
CALCULATE (
COUNT ( 'Ops Data'[Closed Date] ),
FILTER (
'Ops Data',
'Ops Data'[Closed Date].[Year] = YEAR ( TODAY () )
&& 'Ops Data'[Closed Date].[MonthNo]
= MONTH ( TODAY () ) - 1
)
)
)
Best regards,
Yuliana Gu