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
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
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.