Forum Discussion

athersh's avatar
athersh
New Member
2 years ago
Solved

undefined

hi i have data of clients having their ticket numbers i want to calculate number of clients who issued more than 100 tickets

  • athersh,

     

    Try a measure like this:

     

    Clients with over 100 tickets =
    VAR vTicketCount =
        ADDCOLUMNS (
            VALUES ( Table1[Client] ),
            "@Count", CALCULATE ( COUNT ( Table1[Ticket ID] ) )
        )
    VAR vResult =
        COUNTROWS ( FILTER ( vTicketCount, [@Count] > 100 ) )
    RETURN
        vResult
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi athersh 

     

    DataInsights Good share!

     

    For your question, here is the method I provided:

     

    Here's some dummy data

     

    "Table"

     

    Create measures.

     

     

    count_ticket_number = 
        CALCULATE(
            DISTINCTCOUNT('Table'[Ticket Number]), 
            FILTER(
                ALL('Table'), 
                'Table'[customer ID] = MAX('Table'[customer ID])
            )
        )
    

     

     

     

     

    count_customer_100 = 
        CALCULATE(
            DISTINCTCOUNT('Table'[customer ID]), 
            FILTER(
                ALL('Table'), 
                [count_ticket_number] > 5 // Change the judgment condition to be greater than 100
            )
        )

     

     

    Here is the result.

     

    If you still have problems, please provide some dummy data and desired results. It is best presented in table form.

     

    Regards,

    Nono Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

2 Replies

  • athersh,

     

    Try a measure like this:

     

    Clients with over 100 tickets =
    VAR vTicketCount =
        ADDCOLUMNS (
            VALUES ( Table1[Client] ),
            "@Count", CALCULATE ( COUNT ( Table1[Ticket ID] ) )
        )
    VAR vResult =
        COUNTROWS ( FILTER ( vTicketCount, [@Count] > 100 ) )
    RETURN
        vResult
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi athersh 

     

    DataInsights Good share!

     

    For your question, here is the method I provided:

     

    Here's some dummy data

     

    "Table"

     

    Create measures.

     

     

    count_ticket_number = 
        CALCULATE(
            DISTINCTCOUNT('Table'[Ticket Number]), 
            FILTER(
                ALL('Table'), 
                'Table'[customer ID] = MAX('Table'[customer ID])
            )
        )
    

     

     

     

     

    count_customer_100 = 
        CALCULATE(
            DISTINCTCOUNT('Table'[customer ID]), 
            FILTER(
                ALL('Table'), 
                [count_ticket_number] > 5 // Change the judgment condition to be greater than 100
            )
        )

     

     

    Here is the result.

     

    If you still have problems, please provide some dummy data and desired results. It is best presented in table form.

     

    Regards,

    Nono Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.