Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
22 | |
10 | |
10 | |
9 | |
7 |