Forum Discussion
SELECTCOLUMNS with Two Filter Arguements?
Hello I have a table similar to this one below advising you of the syntax for each column. Because my data has errors in the Date Column, I have left that column as text and therfore I have no calendar table connected to it.
I created a new table with the SELECTCOLUMNS DAX with a filter for RecordType since I only want DX and it works fine.
However I would like another filter to remove dates 20201229, 20201230, 20201231 and tried using the EXCEPTALL function but that does not work. It does not seem that I can apply a second filter in SELECTCOLUMNS arguement, and if that is true, do you have another solution?
| Whole Number | Text | Whole Number | Text | Text | Text | Text | $ |
| Social Insurance | Date | Year | RecordType | Month | Comments | Type | Amount |
| 999999999 | 20201227 | 2020 | OA | FT | 1000 | ||
| 999999999 | 20201228 | 2020 | GP | PT | 2000 | ||
| 999999999 | 20201229 | 2020 | GL | FT | 2500 | ||
| 999999999 | 20201230 | 2020 | DX | PT | 800 | ||
| 999999999 | 20201231 | 2020 | PB | FT | 1300 |
CSGP Only =
SELECTCOLUMNS(
FILTER(
'CSLS-PEDU',
'CSLS-PEDU'[RecordType] IN {"DX"}
),
"SIN",
'CSLS-PEDU'[SIN],
"EffDate",
'CSLS-PEDU'[EffDate],
"T4AYear",
'CSLS-PEDU'[T4AYear],
"RecordType",
'CSLS-PEDU'[RecordType],
"Month",
'CSLS-PEDU'[Month],
"Comments",
'CSLS-PEDU'[Comments],
"Type",
'CSLS-PEDU'[Type],
"Amount",
'CSLS-PEDU'[Amount]
)
Anonymous try this:
CSGP Only = SELECTCOLUMNS( FILTER( 'CSLS-PEDU', 'CSLS-PEDU'[RecordType] IN {"DX"} && NOT 'CSLS=PEDU'[Date] IN { 20201229, 20201230,20201231 } ), "SIN", 'CSLS-PEDU'[SIN], "EffDate", 'CSLS-PEDU'[EffDate], "T4AYear", 'CSLS-PEDU'[T4AYear], "RecordType", 'CSLS-PEDU'[RecordType], "Month", 'CSLS-PEDU'[Month], "Comments", 'CSLS-PEDU'[Comments], "Type", 'CSLS-PEDU'[Type], "Amount", 'CSLS-PEDU'[Amount] )Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
2 Replies
- parry2kSuper User
Anonymous try this:
CSGP Only = SELECTCOLUMNS( FILTER( 'CSLS-PEDU', 'CSLS-PEDU'[RecordType] IN {"DX"} && NOT 'CSLS=PEDU'[Date] IN { 20201229, 20201230,20201231 } ), "SIN", 'CSLS-PEDU'[SIN], "EffDate", 'CSLS-PEDU'[EffDate], "T4AYear", 'CSLS-PEDU'[T4AYear], "RecordType", 'CSLS-PEDU'[RecordType], "Month", 'CSLS-PEDU'[Month], "Comments", 'CSLS-PEDU'[Comments], "Type", 'CSLS-PEDU'[Type], "Amount", 'CSLS-PEDU'[Amount] )Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
- onursari2009Frequent Visitor
With AND Operator, only 2 parameter filtered. But i passed the problem "&&" operator with no problem. Thanks for your sharing.