Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Dynamic groups of customers based on usages data in columns

Hi All,

 

I have an excel sheet of application usage analytics structured as follows:

 

Each row represents a customer (customer ID is column A)

Column B onwards - each column represents a piece of functionality in the system.  If the column has a 0 customer has not used this functionality, if 1 present customer has.

 

Id like to be able to group similar patterns of usages into same buckets 

e.g. sum of all cutsomers who have used no functionality (so all 0s in every column) would form initiative 1

All customers with 1 in column b and c would form inititaive B for example

 

So basically, each initiative would be a count of customers based on the same pattern of 0s and 1s in column b onwards 

3 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. Avoid posting screenshots of your source data if possible.

Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

View solution in original post

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

Hi,

In the Query Editor, I used the "Unpivot Other columns" feature.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

9 REPLIES 9
Anonymous
Not applicable

@lbendlin and @Ashish_Mathur quick q - how did you transpose my original data (which had functionality as columns) into the functionality as repeating rows for each customer ID?  Did you do it manually because the data sample was small?  Or is there an automatic way of doing that? Thanks in advance

Hi,

In the Query Editor, I used the "Unpivot Other columns" feature.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

That is by far the most frequently used transformation in Power Query, especially when the data source is Excel. Power Query needs simple tabular format without any fancy grouping or pivoting.

Completely agree.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Wow thank you both for the reply - I will take a look through both PBIX.  Many Thanks

Anonymous
Not applicable

Thank you for the advice.  Below is al ink with sample data and sample structure and a little background into the need.  Appreciate it!

https://docs.google.com/spreadsheets/d/1pr9dHXEuUhLCjLufQfGryIp9Bpm9xiUb/edit?usp=sharing&ouid=11405...

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

"All customers with 1 in column b and c would form inititaive B for example"

 

You need to be more specific.  What are your bucket definitions? Or do you expect the user to make choices on the activities slicer and then the report will calculate the number of customers falling into that pattern?

 

Here is my interpretation:

 

Customers = if(ISFILTERED(Attributes[Activity]),
var r=CALCULATETABLE('Table',TREATAS(FILTERS(Attributes[Activity]),'Table'[Attribute]))
var u = SUMMARIZE(r,'Table'[Customer ID],"smu",sum('Table'[Value]))
var v = FILTER(u,[smu]=COUNTROWS(FILTERS(Attributes[Activity])))
return 0+countrows(v),
var s = SUMMARIZE('Table','Table'[Customer ID],"sm",sum('Table'[Value]))
var t = FILTER(s,[sm]=0)
return 0+countrows(t))
lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. Avoid posting screenshots of your source data if possible.

Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.