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

Total Count Without Duplicates

@vanessafvg 

 

How to Count total number of rows in table after using some filter. I have created column and Measure to calculate number of rows in table but could not get right result.

 

As you can see in pic 4th rows (Yellow Highlighted) has count value 2 insted 1. Total count of table should be 5 insted 6..  Please guide me how can i calculate the right count.BI.PNG

 

 

12 REPLIES 12
v-jiascu-msft
Employee
Employee

Hi @vishalbaldania,

 

Could you please mark the proper answer as solution if it's convenient for you? That will be a help to the others.

 

Best Regards!
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
vanessafvg
Super User
Super User

@vishalbaldania unfortunately with this limited information i would need to be a bit psychic to understand the issue Woman Very Happy

 

as i said i need a screen shot of your relationships if you are using more than one table?

can you also post how you did your measures, the code?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




@vanessafvg 

 

Formula for Column: Column = COUNT(RPT_COMEBACKS[Equipment ID])

 

Formula for Measure: Measure = COUNTROWS(RPT_COMEBACKS)BI1.PNG

 

 

BI2.PNG

 

 

@vishalbaldania so are you wanting a unique count  of equipment id, or just a count of all the rows in the table?

 

Formula for Column: Column = distinctCOUNT(RPT_COMEBACKS[Equipment ID])

 

Formula for Measure: Measure = distinctCOUNT(RPT_COMEBACKS)

 

this is for unique count





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




@vanessafvg

 

Could you please tell me formula for count of all rows in the table. becasue i want to use that as KPI

@vishalbaldania counting all rows is simply countrows(tablename)





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




@vanessafvg

 

As you said i used DISTINCTCOUNT(RPT_COMEBACKS[Equipment ID]) but the still output does not right (you can see in image). if you calculate total number of rows in table then it would be 9 insted 10.

 

I also used COUNTROW: Measure = COUNTROWS(RPT_COMEBACKS) but result is not changed. BI1.PNG

 

 

BI2.PNG

 

 

@vishalbaldania  why are you creating a column?  they should both be measures

 

just so that i understand what you trying to do.

 

you want to see the total rows in the table vs the count of unique equipment id's?

 

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




YES that's right

@vishalbaldania change the column to measure and see if it adjusts it properly

 

ps are you wanting to see the total of all on every row, or only what is related to that row

 

you also need to check your data because the measure might be correct, if you still struggling you can send me your pbix

 

if i am not understanding you 

detail what you expect to see





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




@vanessafvg

As you said i created Measure A and it's works but I can't see the total rows on the bottom. Might be becasue of i used distictcount if i use something else like count or countrows it does not works BI1.PNG

 

 

@vishalbaldania ok but can you tell me what you expect to see there?  because i dont quite understand the issue here,what is the expected value at the bottom the total is going to return a distinct count of all equipment ids, it look  like you only have one equipment id in your table.

 

i am not quite sure what you objective is, if you explain the business requirement mabye i can help you better





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




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.