Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Calculated Column Counting Distinct Values with a Filter

Hey everyone, My first post here and here is the situation: I'm making a dashboard regarding webpage visits. Every visitor has a unique cookie_id. Every visit of a visitor has a unique visit_...
  • Whitewater100's avatar
    Whitewater100
    4 years ago

    Hi:

    The calculated column can be 

    Visit Type =
    VAR visitct = CALCULATE(COUNT(Data[VisitID]), ALLEXCEPT(Data,Data[Cookie ID]))
    return
    IF(visitct = 1, "New", IF(visitct > 1, "Recurring", BLANK()))
     
    However, you will want to use measures as often as possible as best practice. But for sort fields they are great. Here is pie chart using calc columns:
     

     

    I hope this solves the question!