Forum Discussion

e0318476's avatar
e0318476
Helper I
4 years ago
Solved

Returning a result with 1 DAX function and 1 Column

Hi everyone,    I need help in this     'Percentage of Completion' is in calculated from DAX (i.e. Divide 'Modules Completed' with 'Total Modules').   I want to count how many people hav...
  • ryan_mayu's avatar
    4 years ago

    e0318476 

    maybe you can try this

    Measure = 
    VAR tbl=ADDCOLUMNS(SUMMARIZE('Table','Table'[Full Name],"module complete",sum('Table'[modules completed]),"module total",sum('Table'[Total Modules])),"percentage of completion",DIVIDE([module complete],[module total]))
    return CALCULATE(DISTINCTCOUNT('Table'[Full Name]),FILTER(tbl,[percentage of completion]=1))

  • AlexisOlson's avatar
    4 years ago

    Try one of these:

    SUMX (
        VALUES ( Table1[Full Name] ),
        IF ( [Percentage of Completion] = 1, 1 )
    )
    COUNTROWS (
        FILTER (
            VALUES ( Table1[Full Name] ),
            [Percentage of Completion] = 1
        )
    )