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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
orihait
Helper I
Helper I

group by row count

hi guys,

i've got a question for you.

i have two relative datasets,

one is data related to projects with the client id as one of the keys,

the other is another dataset with client id and client names.

example.PNG

my goal is to have a visualization using count of projects as the row filter

based on the tables above it should look something like this.

 

example 2.PNG

as you can see project a and b (and c and d) are owned by the same client so the table above shows

that 2 clients have 2 projects (4 in total). two other clients (4 and 5) have 1 project each (6 in total).

thank you so much in advance 🙂

ori.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @orihait 

 

Not a straight forward one but this is possible.

 

Screenshot_1.png

you need to create a new table with the following DAX

 

number of projects = GENERATESERIES(1,100,1)
this will generate a column with 1 to 100 in the cells
 
Then add a column with
Number of Clients = COUNTAX(FILTER(projects,projects[client ID]='number of projects'[Value]),projects[client ID] = 'number of projects'[Value])
 
Screenshot_2.png
you will end up with a table with 2 columns, a list of how many clients could be attached to a project and how many time that happens. So:
1 client attached = 2 projects
2 clients attached = 2 projects
3 clients attached = 0 projects
etc
 
Then you can create your visual.
 
If this solves your issue please mark this as the solution 🙂

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @orihait 

 

Not a straight forward one but this is possible.

 

Screenshot_1.png

you need to create a new table with the following DAX

 

number of projects = GENERATESERIES(1,100,1)
this will generate a column with 1 to 100 in the cells
 
Then add a column with
Number of Clients = COUNTAX(FILTER(projects,projects[client ID]='number of projects'[Value]),projects[client ID] = 'number of projects'[Value])
 
Screenshot_2.png
you will end up with a table with 2 columns, a list of how many clients could be attached to a project and how many time that happens. So:
1 client attached = 2 projects
2 clients attached = 2 projects
3 clients attached = 0 projects
etc
 
Then you can create your visual.
 
If this solves your issue please mark this as the solution 🙂

hi!,

after thinking about it a little bit more i attempted the solution you provided from a different angle,

first i created a calculated collumn counting how many occurrences of each company register exists in the projects table. then i used the new collumn as the one to compare with the generated table.

thank you so much!!!.

thank you so much!, 

i will check the solution asap and let you know if it works 🙂

hi and again thank you so much for trying to help.

i should have been clearer about client id's format,

i chose the number to simplify the example while client id is the company's register id and thus a text field.

while trying to use the solution you provided i got an error because client id cannout be compared with the integer generated by the GENERATESERIES function.

it should count how many occurrences of clients with 2 projects exist (number of projects is defined by how many rows have the same client id), in the example in the original post there are two clients that match this definition.

thanks again!.

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.