Forum Discussion

PowerBI-Newbie's avatar
6 years ago
Solved

IF Statement with Multiple Columns/Criteria

Hi, I have the following sample data: Ref no. Part No. 1 Part No. 2 Part Name Issue Status Owner Closed Date X1   B1 Part 2         X1 A2 B2 Part 1 Y Open Person A   ...
  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi PowerBI-Newbie ,

     

    Check the following measures.

    Measure1 = CALCULATE(DISTINCTCOUNT('Table'[Ref no.]),FILTER('Table','Table'[Issue]=BLANK()&&'Table'[Part Name]<>BLANK()&&('Table'[Part No. 1]<>BLANK()||'Table'[Part No. 2]<>BLANK())))
    
    Measure2 = CALCULATE(DISTINCTCOUNT('Table'[Ref no.]),FILTER('Table','Table'[Issue]="Y"&&('Table'[Part No. 1]<>BLANK()||'Table'[Part No. 2]<>BLANK())&&'Table'[Part Name]<>BLANK()&&'Table'[Owner]<>BLANK()&&'Table'[Closed Date]<>BLANK()&&'Table'[Status]="Closed"))
    
    Measure3 = SUMX('Table',[Measure1]+[Measure2])

     

    Best Regards,

    Jay

     

    Community Support Team _ Jay Wang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.