Forum Discussion

Cadenze's avatar
Cadenze
Icon for Helper II rankHelper II
3 years ago
Solved

DistinctCount shows 1 when it is 0

I have added a Card to my PowerBI report that shows how many distinct customers are matched, per Reason code. I have 8 lines for 4 customers. so with no filters the card shows 4, which is correct. If...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Cadenze ,

    Please try to create a measure with below dax formula:

    Count of Matched =
    IF ( ISFILTERED ( 'Table'[Reason] ), DISTINCTCOUNT ( 'Table'[Customer] ), 0 )
    

    Please refer the attached .pbix file

     

    Best regards,
    Community Support Team_Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Cadenze's avatar
    3 years ago

    What a cool way to present a solution - thank you! It works 🙂