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 ,
I think you could use filter to achieve this. You could use slicer to filter year, then you could add IsPastMonth in visual or page filter, then choose "Y " in it which will show the past months of your selected year.
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- gco6 years agoResolver II
I have this on my report, but for some reason, it shows only January for both 2020 and 2019. I wanted to be able to display the whole months of 2019, and only January for 2020.
Thanks
Glen
- gco6 years agoResolver II
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