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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.