Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Bpark1994
Helper I
Helper I

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 3
CNENFRNL
Community Champion
Community 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.

Screenshot 2021-02-09 013734.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

wdx223_Daniel
Super User
Super User

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

nandic
Memorable Member
Memorable Member

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"
    )

Concatenatex.PNG

Attached demo file.

 

Regards,
Nemanja Andic

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors