Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hi, I have seen quite a few posts relating to ways of emulating COUNTIF in excel but none of them seem to match what I am after. I have a table in Power BI Desktop I need to add a column that shows an incremental count each time a duplicate value is found in another column. Any help would be appreciated.
RefNumber | NewColumn |
2254 | 1 |
2255 | 1 |
2255 | 2 |
2255 | 3 |
2256 | 1 |
2256 | 2 |
2257 | 1 |
2258 | 1 |
2259 | 1 |
2259 | 2 |
2259 | 3 |
2259 | 4 |
2260 | 1 |
Solved! Go to Solution.
Hi @Metstone
First you need to have a column that establishes an order. Go to the query editor and add an index column (Add Column -> Add Index column)
Then in DAX you can create a new calculated column:
NewCol =
CALCULATE (
COUNT ( Table1[RefNumber] ),
ALLEXCEPT ( Table1, Table1[RefNumber] ),
Table1[Index] <= EARLIER ( Table1[Index] )
)
Hi @Metstone
First you need to have a column that establishes an order. Go to the query editor and add an index column (Add Column -> Add Index column)
Then in DAX you can create a new calculated column:
NewCol =
CALCULATE (
COUNT ( Table1[RefNumber] ),
ALLEXCEPT ( Table1, Table1[RefNumber] ),
Table1[Index] <= EARLIER ( Table1[Index] )
)
Thanks!! That's exactly what I needed.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 8 | |
| 8 | |
| 7 |