Forum Discussion
Using only DAX (not powerquery) drop duplicates based on a single column
- 1 year ago
famousmouse First, create a calculated column to rank the rows based on the "id" column and any other criteria you want to use to determine the "top/highest" row. For example, you can use the "Created" date to determine the most recent entry.
RankColumn =
RANKX(
FILTER(
'YourTable',
'YourTable'[id] = EARLIER('YourTable'[id])
),
'YourTable'[Created],
,
DESC,
DENSE
)Create a calculated table to remove duplicates
FilteredTable =
FILTER(
'YourTable',
'YourTable'[RankColumn] = 1
)
famousmouse First, create a calculated column to rank the rows based on the "id" column and any other criteria you want to use to determine the "top/highest" row. For example, you can use the "Created" date to determine the most recent entry.
RankColumn =
RANKX(
FILTER(
'YourTable',
'YourTable'[id] = EARLIER('YourTable'[id])
),
'YourTable'[Created],
,
DESC,
DENSE
)
Create a calculated table to remove duplicates
FilteredTable =
FILTER(
'YourTable',
'YourTable'[RankColumn] = 1
)