Forum Discussion

dkrishnan's avatar
dkrishnan
Frequent Visitor
7 years ago
Solved

Card - count

Hi All   Thanks in advance for the help.   I am trying to create cards that shows number of customers that is meeting Sales Target as well count that is not meeting the target.   See sample tab...
  • v-lili6-msft's avatar
    7 years ago

    hi, dkrishnan

    After my test, you could try this way:

    measure = CALCULATE(SUM(Table1[Variance] ))
    Result = 
    VAR _table =
        SUMMARIZE ( Table1, Table1[Customer], "var", [measure] )
    RETURN
        IF (
            HASONEVALUE ( Table1[Product] ),
            CALCULATE ( COUNTA ( Table1[Customer] ), FILTER ( Table1, [measure] < 0 ) ),
            CALCULATE ( COUNTAX ( FILTER ( _table, [var] < 0 ), [Customer] ) )
        )

    Result:

     

    here is pbix file, please try it.

     

    Best Regards,

    Lin