Forum Discussion
carloswalder
Jan 21, 2022Copper Contributor
How can I filter a table by two columns in Power BI
Hi, I have a table of order quantities, which has a date column (format: date) and a country column (text). I would like to filter this column by not using e.g. orders from US in second quarter of ...
- Jan 21, 2022I would suggest creating a helper column with a formula like:
="Q"&INT(MONTH([Date])/4)+1 & "-" & YEAR([Date]) & "-" & [Country]
Then filter out "Q2-2021-US"
OliverScheurich
Jan 21, 2022Gold Contributor
=FILTER(A2:D22,(C2:C22<>"US")+((C2:C22="US")*(D2:D22<>8)))
If you work with Office365 or 2021 you can apply FILTER function as well.
mtarler
Jan 21, 2022Silver Contributor
I would suggest creating a helper column with a formula like:
="Q"&INT(MONTH([Date])/4)+1 & "-" & YEAR([Date]) & "-" & [Country]
Then filter out "Q2-2021-US"
="Q"&INT(MONTH([Date])/4)+1 & "-" & YEAR([Date]) & "-" & [Country]
Then filter out "Q2-2021-US"