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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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

3 REPLIES 3
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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.