cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
jmg889 Visitor
Visitor

Assign accounts to Household

Let's say I have the following data:

- 10 Total Account numbers (row records), have one product type of Phone or Internet

- 5 Unique Households (say they're called "Household 1"..."Household 5")

- Each Household (HH) has 2 Accounts

- A HH can be classified as "Double Phone" = 2x Phones,  "Double Internet" = 2x Internet, or "Mix" = 1x of each 

 

So, how do I assign that HH classification to each account?

 

And ideally, that new field (assignment) could be used for grouping purposes and I could study that group.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Re: Assign accounts to Household

HH = 
VAR varPhone = CALCULATE(COUNTROWS('Data'),FILTER(ALLEXCEPT('Data','Data'[Household]),'Data'[Product] = "Phone"))
VAR varInternet = CALCULATE(COUNTROWS('Data'),FILTER(ALLEXCEPT('Data','Data'[Household]),'Data'[Product] = "Internet"))
RETURN
    IF( varPhone > 0, IF(varInternet >0, "Mix", "Phone"),"Internet")

You can try the above. And add this code as a calculated column to your table.  It will give you the following result.

 

2019-07-17_22h05_34.png

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Re: Assign accounts to Household

HH = 
VAR varPhone = CALCULATE(COUNTROWS('Data'),FILTER(ALLEXCEPT('Data','Data'[Household]),'Data'[Product] = "Phone"))
VAR varInternet = CALCULATE(COUNTROWS('Data'),FILTER(ALLEXCEPT('Data','Data'[Household]),'Data'[Product] = "Internet"))
RETURN
    IF( varPhone > 0, IF(varInternet >0, "Mix", "Phone"),"Internet")

You can try the above. And add this code as a calculated column to your table.  It will give you the following result.

 

2019-07-17_22h05_34.png

View solution in original post

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors