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

M Code use aggregatetablecolumn

Hi all,

 

After unsuccesful googling, I'll try to find an answer here:

 

I have following data set 

BertBaeckelmans_0-1606313604924.png

I want to achieve a count on the activities per Case ID preferably in the query (M-code). So in more detail I want to have all distinct Case Id's and I want to count how many Activities happened for a certain case. I am not sure, but I think the aggregatetablecolumn might be useful in order to do this.

 

The result should look something like this:

Case ID:         Number Of Activities:

1                    10

2                    6

3                    1

and so on.

 

Can anyone help me with this?

Have a good one!

 

Thanks,

Bert

1 REPLY 1
Fowmy
Super User
Super User

@Anonymous 

In power query, right-click on the case id column, select GROUP BY,  Choose CountRows

 

Fowmy_0-1606314610279.png

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

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.