Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
trideepnath
New Member

No of times a value previously repeats in a column, appears in another column in the same table(DAX)

Number of times a value previously repeats in a column, appears in another column in the same table.
Whatever is there in column unique response is checked and unique count is calculated .

Just as an example abc appears 3 times. unique count will be 1, 2 and 3 sequentially. 

 

Unique ResponseUnique Count
abc1
xyz1
bce1
abc2
xye1
32d1
abc3
xyz2
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @trideepnath 

You should add a index column for duplicate values in your table . 

Ailsamsft_0-1667528949925.png

Then create a calculated column with COUNTROWS() to count duplicate values . 

 

Column = 
var _currentResponse='Table'[Unique Response]
var _currentIndex='Table'[Index]
return COUNTROWS(FILTER('Table','Table'[Index]<_currentIndex && 'Table'[Unique Response]=_currentResponse))+1

 

You will get a result like this :

Ailsamsft_1-1667529163041.png

Best Regards,
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @trideepnath 

You should add a index column for duplicate values in your table . 

Ailsamsft_0-1667528949925.png

Then create a calculated column with COUNTROWS() to count duplicate values . 

 

Column = 
var _currentResponse='Table'[Unique Response]
var _currentIndex='Table'[Index]
return COUNTROWS(FILTER('Table','Table'[Index]<_currentIndex && 'Table'[Unique Response]=_currentResponse))+1

 

You will get a result like this :

Ailsamsft_1-1667529163041.png

Best Regards,
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@trideepnath , First if all add an index column in power query

Power Query- Index Column: https://youtu.be/NS4esnCDqVw

 

Then in dax add a new column

countx(filter(Table, [Unique Response] = earlier([Unique Response])  && [index] <= earlier( [index] )) , [Index])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
trideepnath
New Member

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.