Forum Discussion
How to filter with multiple values in multiple columns
- 8 years ago
Hi edhans,
I want Jan 2014 - Sep 2017.
2014, 1-12
2015, 1-12
2016, 1-12
2017, 1-09
You should be able to use the M query below to filter the date column in this scenario. :smileyhappy:
FilterRows = Table.SelectRows(dbo_DimDate, each ([CalendarYear]*12+[MonthNumberOfYear]>=(2014*12+1))and(([CalendarYear]*12+[MonthNumberOfYear]<=(2017*12+9)))) in FilterRowsRegards
you should use between when filtering between 2014 and 2017 and similar to month
parry2k wrote:you should use between when filtering between 2014 and 2017 and similar to month
How would that look? I cannot even write that down on paper?
(between 2014 and 2017) and (between 1 and 9) wouldn't work
(between 2014 and 1) and (2017 and 9) wouldn't work either as I don't see how the logic would tell the system to get 2015 and 3
- parry2k8 years agoSuper User
why this will not work:
(between 2014 and 2017) and (between 1 and 9) wouldn't work
- edhans8 years agoCommunity Champion
parry2k wrote:why this will not work:
(between 2014 and 2017) and (between 1 and 9) wouldn't work
Because that will only give me months 1-9 in 2014, 2015, 2016, and 2017.
It will omit months 10-12 in 2014, 2015, and 2016.
I want Jan 2014 - Sep 2017.
2014, 1-12
2015, 1-12
2016, 1-12
2017, 1-09
- v-ljerr-msft8 years agoMicrosoft Employee
Hi edhans,
I want Jan 2014 - Sep 2017.
2014, 1-12
2015, 1-12
2016, 1-12
2017, 1-09
You should be able to use the M query below to filter the date column in this scenario. :smileyhappy:
FilterRows = Table.SelectRows(dbo_DimDate, each ([CalendarYear]*12+[MonthNumberOfYear]>=(2014*12+1))and(([CalendarYear]*12+[MonthNumberOfYear]<=(2017*12+9)))) in FilterRowsRegards