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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
koorosh
Post Partisan
Post Partisan

Duplicate value

Hello experts,

 

How to find repetitious value in the column name and then enter them with their path to a new table?

koorosh_0-1723759168330.png

 

1 ACCEPTED SOLUTION
Sergii24
Super User
Super User

Hi @koorosh, the easiest way is to add "calculated column" to your table to count current name occurences:

CountName = 
VAR _NameOnACurrentRow = 'Table'[Name]      //Name at currently iterating row
RETURN
    COUNTROWS(                              //needs to aggregate the table (i.e. find number of rows)
        FILTER(
            'Table',                        //all table "Table"
            [Name] = _NameOnACurrentRow     //filtered with a value of currently iterating row
        )
    )


This will give you the following table:

Sergii24_0-1723760901348.png


Now, when creating a new table the only thing you need to do is to filter this table:

Sergii24_1-1723761030055.png


Here is DAX code:

Repetitive values = 
    FILTER(
        'Table',
        [CountName] > 1
    )

 

If you prefer you can avoid creation of calculated column by combining steps in new table definition

Repetitive values = 
VAR _TableWithCount =
    ADDCOLUMNS(
        'Table',
        "@CountName", 
            VAR _CurrentName = 'Table'[Name]
            RETURN
                COUNTROWS(
                    FILTER( 
                        'Table', 
                        [Name] = _CurrentName 
                    )
                )
    )

RETURN
    FILTER(
        _TableWithCount,
        [@CountName] > 1
    )


Good luck with your work! 🙂

View solution in original post

3 REPLIES 3
Sergii24
Super User
Super User

Hi @koorosh, the easiest way is to add "calculated column" to your table to count current name occurences:

CountName = 
VAR _NameOnACurrentRow = 'Table'[Name]      //Name at currently iterating row
RETURN
    COUNTROWS(                              //needs to aggregate the table (i.e. find number of rows)
        FILTER(
            'Table',                        //all table "Table"
            [Name] = _NameOnACurrentRow     //filtered with a value of currently iterating row
        )
    )


This will give you the following table:

Sergii24_0-1723760901348.png


Now, when creating a new table the only thing you need to do is to filter this table:

Sergii24_1-1723761030055.png


Here is DAX code:

Repetitive values = 
    FILTER(
        'Table',
        [CountName] > 1
    )

 

If you prefer you can avoid creation of calculated column by combining steps in new table definition

Repetitive values = 
VAR _TableWithCount =
    ADDCOLUMNS(
        'Table',
        "@CountName", 
            VAR _CurrentName = 'Table'[Name]
            RETURN
                COUNTROWS(
                    FILTER( 
                        'Table', 
                        [Name] = _CurrentName 
                    )
                )
    )

RETURN
    FILTER(
        _TableWithCount,
        [@CountName] > 1
    )


Good luck with your work! 🙂

Hi Sergii,

The first calculated column make the following result:

koorosh_0-1723830336132.png

And the create table make the following:

koorosh_1-1723830387661.png

But now we have a table with duplicated rows. We need just one row for John and one row for Mike???

It should be as the following

 

koorosh_2-1723831014635.png

 

Helpful resources

Announcements
Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.