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 dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Folks,
I am not sure how do i asiign same groupids to the rows that have same values across multiple column and also if possible add a flag for duplicacy. So I have a table that looks like below:
UniqueID | InvNumber | InvComp | InvRefrence | InvGrossAmount |
1 | INV1234 | 121 | Test | 203.12 |
2 | INV1234 | 121 | Test | 203.12 |
3 | INV5678 | 72 | Pass | 677777 |
4 | INV1123 | 234 | Loan | 23070 |
5 | INV5678 | 72 | Pass | 677777 |
In the same table, I want to add an additional column to assign the same groupID wherever the values for the below column are same.
InvNumber | InvComp | InvRefrence | InvGrossAmount |
After adding the columns the desired table should look like below: Line 1 and 2 have the same value across an hence have the same groupid and flag as TRUE for duplicacy.
UniqueID | InvNumber | InvComp | InvRefrence | InvGrossAmount | GroupID | Duplicate |
1 | INV1234 | 121 | Test | 203.12 | 1 | TRUE |
2 | INV1234 | 121 | Test | 203.12 | 1 | TRUE |
3 | INV5678 | 72 | Pass | 677777 | 2 | TRUE |
4 | INV1123 | 234 | Loan | 23070 | 3 | FALSE |
5 | INV5678 | 72 | Pass | 677777 | 2 | TRUE |
Is there a way I can achieve the above using DAX query only. The connection for the powerbi file is going to the Diret query mode and hence, appreciate any solution that will work for direcy connection.
@AP_S , Create a Rank
Group ID = Rankx(Table, Table[InvNumber], ,asc,dense)
Duplicate =
if(countx(filter(Table, [InvNumber] = earlier([InvNumber]) ),[InvNumber]) +0 >1, True(), false())
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
30 | |
13 | |
11 | |
9 | |
6 |