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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
YonghunLee
Helper I
Helper I

How can I declare a field as Identity field?

How can I declare a field as Identity field as picture below? 

 

Image 013.png

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @YonghunLee 

If you means to create unique id in power bi, it is possible as long as for the same name(different people), there are different values in other columns.

You could create index column with DAX as below:

https://community.powerbi.com/t5/Desktop/Create-unique-ID/td-p/677570

For example,create a column below:

Final Rank =
RANKX (
    Table,
    RANKX ( Table, [Primary column],, ASC )
        + DIVIDE (
            RANKX ( Table, [Secondary column],, ASC ),
            ( COUNTROWS (Table ) + 1 )
        )
)
rank as unique id = 
RANKX (
    'Table (2)',
    RANKX ( 'Table (2)', [name],, ASC )
        + DIVIDE (
            RANKX ( 'Table (2)', [column1],, ASC ),
            ( COUNTROWS ( 'Table (2)' ) + 1 )
        ),,ASC,Dense
)

Capture1.JPG

 

 

Best Regards
Maggie
Community Support Team _ Maggie Li
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

4 REPLIES 4
HalloWorld
Advocate II
Advocate II

- You can go to the visualisation pane, right click on the field and choose not to aggregate. Then it will be spread at least across all distinct values of that column.

- If you create an identity column already in TSQL or if you make it in the Power Query Editor (by the way, you can make the new column an index column in Power Query), you can choose "no aggregation" for that column in the visualisation pane as well, and by that, you will spread the table across all rows.

- If you have a column that already is an identity (unique in each value of the column), then you can just as well choose in the visualisation pane "not to aggregate" that, without the need to make a new identity column.

 

Here is how you set a column to "do not aggregate" in German:

 

HalloWorld_0-1734450211800.png

 

serhii_stefaniv
Frequent Visitor

Hey there. I have the same issue. Have you found the solution?

polymathy2017
Advocate III
Advocate III

Ugh! I"m going to have to find another community. Can't seem to find actual answers in here very often. Frustrating.

v-juanli-msft
Community Support
Community Support

Hi @YonghunLee 

If you means to create unique id in power bi, it is possible as long as for the same name(different people), there are different values in other columns.

You could create index column with DAX as below:

https://community.powerbi.com/t5/Desktop/Create-unique-ID/td-p/677570

For example,create a column below:

Final Rank =
RANKX (
    Table,
    RANKX ( Table, [Primary column],, ASC )
        + DIVIDE (
            RANKX ( Table, [Secondary column],, ASC ),
            ( COUNTROWS (Table ) + 1 )
        )
)
rank as unique id = 
RANKX (
    'Table (2)',
    RANKX ( 'Table (2)', [name],, ASC )
        + DIVIDE (
            RANKX ( 'Table (2)', [column1],, ASC ),
            ( COUNTROWS ( 'Table (2)' ) + 1 )
        ),,ASC,Dense
)

Capture1.JPG

 

 

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

Helpful resources

Announcements
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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.