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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Count number of rows where the same ids

Hi, 

 

I hope you can help me. I am quite new in powerbi. 

 

I have a table where ids reoccure, and I want to count total number of rows. I have tried countrows however it only counts the same id once... Is this possible to bypass? 

 

Best regards 🙂

1 ACCEPTED SOLUTION
Anonymous
Not applicable

It was a wrong relation between two tables. Ups! 

View solution in original post

15 REPLIES 15
tamdo95
Frequent Visitor

Hello,
In this case, I think you can use the COUNTROWS function. I hope this will help.

Anonymous
Not applicable

Hi Tamdo, 

 

I tried that but it returns the same number 

It depends on which visual you are using as well. Could you be more specific?

Anonymous
Not applicable

Hi again, i solved the problem. Thank you so much for your time!

 

PiEye
Resolver II
Resolver II

Which function are you using? Count() should return 10, but there is also a function called DISTINCTCOUNT() which will return the smaller number.

Also is your measure in the same table as where the ID is residing?

Anonymous
Not applicable

I am using count and it returns the smaller number, and i am doing it in another column 

 

Is it the same table? What does your data model look like?

Anonymous
Not applicable

Yes it is the same table, i tried adding a new column 

 

Do you have more information you can give us? I'm trying to recreate the issue, but can only make it happen if  the ID field is in a different table to the one with the measure

Anonymous
Not applicable

Hi again, i solved the problem. Thank you so much for your time!

That's great Jarken - what was the issue?

 

Pi

Anonymous
Not applicable

It was a wrong relation between two tables. Ups! 

Good to know!

PiEye
Resolver II
Resolver II

Hi Jarken, can you elaborate?

Your  data looks something like this:

ID

1

1

1

2

2

3

4

5

5

6

 

You want a total count of 10, but it is showing 6?

 

Pi

 

Anonymous
Not applicable

Hi, 

 

Yes exactly, thank you for specifying! 😊

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors