Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I have a table like below where I want the id of the duplicate records to be same.
Current Data
Sno | Name | value |
1 | John | 20 |
2 | John | 30 |
3 | Jill | 40 |
4 | Kirk | 50 |
5 | Kirk | 60 |
Expected
Sno | Name | value |
1 | John | 20 |
1 | John | 30 |
2 | Jill | 40 |
3 | Kirk | 50 |
3 | Kirk | 60 |
Thanks,
Ravi
Solved! Go to Solution.
Another approach in DAX.
RANK_SNO = RANKX ( 'Table', CALCULATE ( MIN ( 'Table'[Sno] ), FILTER ( 'Table', EARLIER ( 'Table'[Name] ) = 'Table'[Name] ) ), , ASC, DENSE )
Another approach in DAX.
RANK_SNO = RANKX ( 'Table', CALCULATE ( MIN ( 'Table'[Sno] ), FILTER ( 'Table', EARLIER ( 'Table'[Name] ) = 'Table'[Name] ) ), , ASC, DENSE )
Thanks Eric and Marcel , I have worked out both and works perfectly fine.
@Eric_Zhang If I have the data without the S.no column and if I have the same Values for the same name in this case (John 20)would it be possible to acheive the same using RankX
, I used this but I am not getting the Correct output
Column = RANKX(Sheet1,
Sheet1[Name]
,
,ASC,Dense)
Name | value |
John | 20 |
John | 20 |
Jill | 40 |
Kirk | 50 |
Kirk | 60 |
Steps:
Code:
let Source = CurrentData, #"Removed Columns" = Table.RemoveColumns(Source,{"Sno"}), #"Grouped Rows" = Table.Group(#"Removed Columns", {"Name"}, {{"AllData", each _, type table}}), #"Added Index" = Table.AddIndexColumn(#"Grouped Rows", "Sno", 1, 1), #"Expanded AllData" = Table.ExpandTableColumn(#"Added Index", "AllData", {"value"}, {"value"}), #"Removed Other Columns" = Table.SelectColumns(#"Expanded AllData",{"Sno", "Name", "value"}) in #"Removed Other Columns"
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
61 | |
60 | |
54 | |
38 | |
27 |
User | Count |
---|---|
86 | |
61 | |
45 | |
41 | |
39 |