Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Distinct Count based on 2 columns in same table

I've seen many variations of this question and every answer I've seen doesn't work for me.  It's driving me crazy.  I hate DAX because this should be so simple! (like it is in SQL and Excel)   Ulti...
  • Cmcmahan's avatar
    Cmcmahan
    7 years ago

    I'm not sure I understand the block here.  What's keeping you from filtering on CustCount?  It was very easy to add this filter:

     

    If you're trying to use this value in a slicer, just add calculated columns to your data and use those instead:

    CustCountColumn = CALCULATE( COUNTROWS(RawData), FILTER(RawData, RawData[Address]=EARLIER(RawData[Address]) && RawData[Customer] = EARLIER(RawData[Customer])))
    CustCountCol = CALCULATE( COUNTROWS(RawData), FILTER(RawData, RawData[Customer] = EARLIER(RawData[Customer])))