Forum Discussion

Bpark1994's avatar
Bpark1994
Icon for Helper I rankHelper I
5 years ago

Need Dax Help Please!

Hi guys,

 

Here is my starting table im pulling into power bi:

 

UserTask
john70
jim70
john71
john30

 

I want to write a dax function called Qualified that says if a user has both task 70 and task 71 then YES else NO

This is a simplified example but in some cases there will be many conditions being evaluated so just want to know the best way to write this dax function. 

 

Desired end result:

UserQualified?
johnYES
jimNO

 

 

Thanks!

3 Replies

  • nandic's avatar
    nandic
    Icon for Resident Rockstar rankResident Rockstar

    Hi,
    Could you try this formula:

    Concatenax Value =
    VAR Concat =
        CALCULATE (
            CONCATENATEX ( 'Table', 'Table'[Task], "," ),
            ALLEXCEPT ( 'Table', 'Table'[User] )
        )
    RETURN
        IF (
            AND ( CONTAINSSTRING ( Concat"70" )CONTAINSSTRING ( Concat71 ) ),
            "Yes",
            "No"
        )



    Attached demo file.

     

    Regards,
    Nemanja Andic

  • wdx223_Daniel's avatar
    wdx223_Daniel
    Icon for Community Champion rankCommunity Champion

    measure=if(sumx({70,71},if([value] in values(table[task]),1))=2,"yes","no")

  • CNENFRNL's avatar
    CNENFRNL
    Icon for Community Champion rankCommunity Champion

    Bpark1994 , here's an extended model addressing your question. By choosing one or more tasks to test if a candidate is qualified or not; those who have all the chosen task(s) in the slicer are qualified.