Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
As part of my finance model I have a table Purchase Orders with several columns of which one is [PO Number] as below.
Purchase Orders Table
If I go to PowerBI data area and click on PO Number I see the Table: references with distinct values as shown below.
Distinct Values as shown
If I create a table and drag Purchase Orders into Visual level filters & select Count (Distinct) [see below] i get the result 102
Count (Distinct)
If I create the measure Count rows = COUNTROWS(VALUES('Purchase Orders'[PO NUMBER] )) i get the number 103
The DATA comes from an excel spreadsheet.
I'm trying to udnerstand what countrows is doing and whether this is the incorrect measure to use to count rows?
Regards B00M3R
countrows is the correct formula, but you shouldn't need values. Just count the rows of the table (given po is unique).
This is very strange. Any chance that you have two tables that contain PO number?
Hi Matt
Yes i have discovered it in the main data fact table. Would this be the issue?
Hi @B00m3r,
In my test, COUNTROWS function returns correct result, the same as selecting Count(distinct) for field. So, I think this problem is related to specific data. Could you provide more sample data or share .pbix file directly?
Besides, please try below measure to check whether it returns 102 or 103.
Count rows = DISTINCTCOUNT('Purchase Orders'[PO NUMBER] )
Best regards,
Yuliana Gu
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 41 | |
| 37 | |
| 34 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 65 | |
| 59 | |
| 31 | |
| 25 | |
| 25 |