cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Highlighted
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
Highlighted
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
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

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.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors