Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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.
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
@vishalbaldania unfortunately with this limited information i would need to be a bit psychic to understand the issue ![]()
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?
Proud to be a Super User!
Formula for Column: Column = COUNT(RPT_COMEBACKS[Equipment ID])
Formula for Measure: Measure = COUNTROWS(RPT_COMEBACKS)
@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
Proud to be a Super User!
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)
Proud to be a Super User!
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.
@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?
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
Proud to be a Super User!
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
@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
Proud to be a Super User!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 133 | |
| 88 | |
| 85 | |
| 68 | |
| 64 |