Forum Discussion

MattConner's avatar
MattConner
Frequent Visitor
6 years ago
Solved

Need help with a measure or two - Distinct Count based on multiple conditions

As a precursor , this is in a live connection environment.   Using the below example table titled "Parent Clients" I need a couple of measures, and I am stumped.      First, and most impor...
  • v-eachen-msft's avatar
    6 years ago

    Hi MattConner ,

     

    Considering that you are under an environment using Live Connection, I created two measures.

    Measure =
    VAR a =
        CALCULATE (
            MAX ( 'Table'[YTD Revenue] ),
            ALLEXCEPT ( 'Table', 'Table'[Client] )
        )
    VAR b =
        CALCULATE (
            MIN ( 'Table'[YTD Revenue] ),
            ALLEXCEPT ( 'Table', 'Table'[Client] )
        )
    RETURN
        IF ( a >= 250 && b >= 250 && a <> b, 1, 0 )
    Measure 2 =
    SUMX ( FILTER ( 'Table', [Measure] = 1 ), 'Table'[YTD Revenue] )

    I think you want to calculate the count, here is the measure. You can use card visual to show it

    MeasureCount = 
    CALCULATE(DISTINCTCOUNT('Table'[Client]),FILTER('Table',[Measure]=1))

    Here is the result.