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

The Fabric Community site will be in read-only mode on Monday, Feb 24 from 12:01 AM to 8 AM PST for scheduled upgrades.

Reply
DataAnalysis
Frequent Visitor

How to Count Duplicated row?(Distinct Column? Index Column?)

Hello.
I am PowerBI User living in Korea.
I solved many problems with your help. Thank you very much.

Data processing is required by utilizing duplicate data.
My current table is as follows.
For data with duplicate case numbers Column, I would like to calculate the number of duplicate columns. (Count of Duplicate Row at Case Number Column)
Using the calculated values, I would like to create a new Hours Duplicate Row column and divide the Actual Hours by the duplicate number of columns.

I've tried a lot of things using the Index Column, but it's hard with my ability.
I need a lot of your advice.
I need your help.

DataAnalysis_0-1649410187848.png

※ The blue painted part is the original Data and the yellow painted part is the result of the column I want.

2 ACCEPTED SOLUTIONS
johnt75
Super User
Super User

I think you can do this in Power Query. Select the case number column and choose Group By. Add 2 aggregations, 1 using count rows and 1 using all rows. You can expand the 2nd column to bring back all the data, and then add another new column dividing the actual hours column by the num duplicates column.

View solution in original post

Shishir22
Solution Sage
Solution Sage

Hello @DataAnalysis,

 

Try measure as- 

CountofDuplicateRow = CALCULATE(COUNT('Table'[CaseNumber]),ALLEXCEPT('Table','Table'[CaseNumber]))
HoursDivideDuplicateRow = Divide(AVERAGE('Table'[ActualHours]),[CountofDuplicateRow])

 

Please accept it as solution if it solves your issue. Kudos are also appreciated.

 

Cheer,

Shishir

 

Cheers,
Shishir

View solution in original post

4 REPLIES 4
Data-Rainer
Advocate IV
Advocate IV

Greetings from New Zealand,
I had the exact same question, and solved it for me in a simpler way via a CALCULATED COLUMN:

CountofDuplicateRow = CALCULATE(COUNT([CaseNumber]))
Shishir22
Solution Sage
Solution Sage

Hello @DataAnalysis,

 

Try measure as- 

CountofDuplicateRow = CALCULATE(COUNT('Table'[CaseNumber]),ALLEXCEPT('Table','Table'[CaseNumber]))
HoursDivideDuplicateRow = Divide(AVERAGE('Table'[ActualHours]),[CountofDuplicateRow])

 

Please accept it as solution if it solves your issue. Kudos are also appreciated.

 

Cheer,

Shishir

 

Cheers,
Shishir
mh2587
Super User
Super User

CALCULATE (
COUNT ( [CaseNumber] ), FILTER ( TableName, [CaseNumber] = EARLIER ( [CaseNumber] ) ) )

Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



johnt75
Super User
Super User

I think you can do this in Power Query. Select the case number column and choose Group By. Add 2 aggregations, 1 using count rows and 1 using all rows. You can expand the 2nd column to bring back all the data, and then add another new column dividing the actual hours column by the num duplicates column.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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