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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

Top Solution Authors