none
Count distinct values if condition is true

    Question

  • I am completely new to Tabular model and DAX..I am trying to create a measure which counts distinct values from columnA when value in columnB is true

    e.g.

    columnA columnB

    abc true

    xyz false

    pqr true

    abc true

    DistinctCount = 2


    Thursday, May 01, 2014 7:12 PM

Answers

  • Try this:

    DistinctCountColumnA:=
    CALCULATE(
        DISTINCTCOUNT(TableName[columnA]), 
        TableName[columnB] = TRUE()
    )

    • Marked as answer by rockstar2831 Thursday, May 01, 2014 7:33 PM
    Thursday, May 01, 2014 7:21 PM
    Answerer

All replies