Forum Discussion
Help with filters
- 6 years ago
dax Anonymous ,
I was able to fix my problem by modifying the IsLastMonth calculated column as follows:
Old Value:
IsLastMonth = if Date.Month([#"FullDate"]) < (Date.Month(DateTime.LocalNow()) then "Y" else "N"
New Value:
IsLastMonth = if (Date.Month([#"FullDate"]) < (Date.Month(DateTime.LocalNow()))) or (Date.Year([#"FullDate"]) < (Date.Year(DateTime.LocalNow())))
then "Y" else "N"This allowed the whole 2019 to be past month and January for 2020.
Thank you
Glen
Hi gco ,
There should not be much else to do.
Depending on an approach you can either add a new column (Year) in the dataset and create a slicer from this column (and Y/N IsPastMonth filter on the visual containing "months") or you can go with grouping FullDates into years - I went with creating a group on the slicer visual binned to years.
The key, I guess, is to add the IsPastMonth filter to the either report, page or visual filters (just drag&drop in the filters section and set to "Y").
Kind regards,
JB