Forum Discussion

Jumpin1c4's avatar
Jumpin1c4
New Member
1 year ago
Solved

Newbie Question Help

Any help or advice would be appreciated.  I have a table with a list of devices for various customers.  I am trying to categorize the customers by the average age of their devices.  Customers with an...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Jumpin1c4 ,

     

    Thanks to SachinNandanwar  and audreygerred  for their quick replies. I have some other thoughts to add:

    (1) This is my test data.

    (2) We can create measures.

    CustomerAvgAge = 
    CALCULATE(
        AVERAGE('Devices'[DeviceAge]),
        ALLEXCEPT('Devices', 'Devices'[CustomerID])
    )
    CustomerAgeGroup = 
    SWITCH(
        TRUE(),
        [CustomerAvgAge] <= 2, "0 to 2 years",
        [CustomerAvgAge] <= 5, "2 to 5 years",
        "Over 5 years"
    )

    Best Regards,

    Neeko Tang

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