Forum Discussion

SylvainHG's avatar
SylvainHG
Regular Visitor
2 years ago
Solved

Help in filtering data

Dear community,   I'm using a set of data from customers that i upload in a SQL database and I need help to analyse.   I'd like to use the data of customers if they use at least 2 differents prod...
  • Alican_C's avatar
    2 years ago

    Hi,

     

    Create a calculated column to count the number of distinct products each customer has used:

    ProductCount = CALCULATE( DISTINCTCOUNT(CustomerData[ID_product]), ALLEXCEPT(CustomerData, CustomerData[CustomerID]) )

     

    Create another calculated column to count the total number of usages for each customer:

    UsageCount =
    CALCULATE(
    COUNT(CustomerData[UsageDate]),
    ALLEXCEPT(CustomerData, CustomerData[CustomerID])
    )

     

    Create a calculated column to identify customers who meet both criteria (using at least 2 different products and having at least 5 usages):

     

    IsQualified =
    IF(
    [ProductCount] >= 2 && [UsageCount] >= 5,
    1,
    0
    )

    You can now use this IsQualified column to filter your visuals. For example, if you are creating a table or chart, you can add a visual-level filter to only include rows where IsQualified is 1.