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!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi - me again. Source data is employee expense submissions in a SQL table via Direct Query. I want to count the number of expense reports by employee for a given date range (slicer). I've tried:
= DISTINCTCOUNT (Expenses[ReportNumber] )
= COUNTROWS(DISTINCT(SELECTCOLUMNS(FILTER(Expenses,Expenses[ReportNumber]<>0),"Reports",Expenses[ReportNumber])))
I know this has to be possible -- what am I doing wrong??
Im sorry. Instead of primairy key i meant your name column. But im afraid this operation over this column has performance issues
I don't want to countrows of the name column though because one name may have 500 unique expense reports. I want to identify the number of expense reports per person (not number of expense submissions).
So then do COUNTROWS(ALL(Expenses[ReportNumber]))
That doesn't work, but I figured it out anyway. Thanks!
COUNTROWS(ALL('Table'[Primairy key])) is working fine for me
This displayed the same value for every employee which is not correct, but it did return a result which is an improvement from my previous attempts!
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 66 | |
| 60 | |
| 45 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 109 | |
| 108 | |
| 39 | |
| 30 | |
| 27 |