Forum Discussion

Nitraz's avatar
Nitraz
Frequent Visitor
3 years ago
Solved

DAX Measure - Count If

I have the below data loaded in PBI.

StationFull nameEmployee IDAverage scoreAssessment resultOverall Assessment Summary
Station 1Jayesh Thundathil1186464%Competent 
Station 2Jayesh Thundathil11864100%Competent 
Station 1Nitraz 1216573%Competent 
Station 2Nitraz 1216565%Competent 
Station 1Nitraz 2516127%Not competent 
Station 2Nitraz 2516194%Competent 
Station 1Nitraz 3315155%Not competent 
Station 2Nitraz 3315159%Not competent 
Station 1Nitraz 41546164%Competent 
Station 2Nitraz 415461100%Competent 
Station 1Nitraz 53645664%Competent 
Station 2Nitraz 53645647%Not competent 
Station 1Nitraz 6789473%Competent 
Station 2Nitraz 678940%Not competent 
Station 1Nitraz 7654936%Not competent 
Station 2Nitraz 7654947%Not competent 
Station 1Nitraz 8365282%Competent 
Station 2Nitraz 8365282%Competent 
Station 1Severine 11234555%Not competent 
Station 2Severine 11234565%Competent 

The criteria for the overall assessment summary is that an employee is 'Competent' if he/she is competent in both station 1 and station 2, if not he/she is 'Not competent'. Basically, I want to count number of 'Competent' for each employee and if it equals to 2, marks the employee as 'Competent' and if less than 2, then marks the employee as 'Not competent'.

How to proceed to write this measure?  I would like to create a chart to show the overall assessment summary as shown below.

 

 

5 Replies

  • Hello Nitraz,

    You can try something like this:

    In plain text for convenience:

    Measure = 
    COUNTX ( 
        FILTER (
            ADDCOLUMNS ( VALUES ( data[Full name] ), 
                        "Counter", 
                        VAR _CurrentName = [Full name]
                        RETURN COUNTX ( FILTER ( data, [Full name] = _CurrentName && [Assessment result] = "Competent" ), [Full name] ) ), 
        [Counter] = 2 ), 
    [Full name] )

     Best Regards,

    Alexander

    My YouTube vlog in English

    My YouTube vlog in Russian

    • Nitraz's avatar
      Nitraz
      Frequent Visitor

      Hi barritown 

      Thanks for creating the measure to show who are 'competent' but I need to show who are 'not competent' as well in the same chart as shown below. How to proceed?