Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

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 NumberTextWhole NumberTextTextTextText$
Social InsuranceDateYearRecordTypeMonthCommentsTypeAmount
999999999202012272020OA  FT1000
999999999202012282020GP  PT2000
999999999202012292020GL  FT2500
999999999202012302020DX  PT800
999999999202012312020PB  FT1300

 

 

 

 

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

  • 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.

    • onursari2009's avatar
      onursari2009
      Frequent Visitor

      With AND Operator, only 2 parameter filtered. But i passed the problem "&&" operator with no problem. Thanks for your sharing.