Forum Discussion
Writing a date filter in a measure
- 4 years ago
Hi, mzienowicz99
According to your description, I think [activity_month] column is a date column or a string column.
If it is a date column, you can use [activity_month]=date(2021,10,1). If it is a string column, you can use [activity_month]="2021-10".
Like this:
YTY Variance = CALCULATE ( CALCULATE ( [QTY], R2_INDUSTRY[BRAND] = "JOHN DEERE", R2_INDUSTRY[ACTIVITY_MONTH] = "2021 - 10" //R2_INDUSTRY[ACTIVITY_MONTH] = date(2021,10,1) ) - ( CALCULATE ( [QTY], R2_INDUSTRY[BRAND] = "JOHN DEERE", R2_INDUSTRY[ACTIVITY_MONTH] = "2020 - 10" //R2_INDUSTRY[ACTIVITY_MONTH] = date(2020,10,1) ) ) )Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.Best Regards,
Community Support Team _ Janey
Hi, mzienowicz99
According to your description, I think [activity_month] column is a date column or a string column.
If it is a date column, you can use [activity_month]=date(2021,10,1). If it is a string column, you can use [activity_month]="2021-10".
Like this:
YTY Variance =
CALCULATE (
CALCULATE (
[QTY],
R2_INDUSTRY[BRAND] = "JOHN DEERE",
R2_INDUSTRY[ACTIVITY_MONTH] = "2021 - 10" //R2_INDUSTRY[ACTIVITY_MONTH] = date(2021,10,1)
)
- (
CALCULATE (
[QTY],
R2_INDUSTRY[BRAND] = "JOHN DEERE",
R2_INDUSTRY[ACTIVITY_MONTH] = "2020 - 10" //R2_INDUSTRY[ACTIVITY_MONTH] = date(2020,10,1)
)
)
)
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.
Best Regards,
Community Support Team _ Janey
- mzienowicz994 years ago
Helper I
THANK U, that solution works perfect 🙂