Forum Discussion

Martin0011's avatar
Martin0011
Frequent Visitor
2 years ago
Solved

Identify duplicate supplier using measure

Se the 2 tables I have with a relation with Vendor ID Vendor   TAX Vendor ID Available For use   Vendor ID Tax 1 Yes   1 A 2 Yes   2 B 3 No   3 C 4 No   4 A ...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Martin0011

     

    You can create several measures as follow.

     

    Duplicate = IF(CALCULATE(COUNT('TAX'[Tax]),'TAX'[Tax] = MAX('TAX'[Tax]), ALL('Vendor'[Vendor ID])) > 1, "Y", "N")

     

     

     

    Duplicate List = IF([Duplicate] = "Y", CONCATENATEX(FILTER(ALLSELECTED('TAX'), 'TAX'[Tax] = MAX('TAX'[Tax])), 'TAX'[Vendor ID], ","))

     

     

     

    Duplicate Group = 
    IF (
        [Duplicate] = "Y",
        RANKX (
            FILTER (
                ADDCOLUMNS (
                    ALLSELECTED ( 'Vendor'[Vendor ID] ),
                    "@Duolicate", [Duplicate],
                    "@DuplicateList", [Duplicate List]
                ),
                [@Duolicate] = "Y"
            ),
            [Duplicate List],
            ,
            ASC,
            DENSE
        ),
        "-"
    )

     

     

     

    Is this the result you expect?

     

    Best Regards,
    Community Support Team _Yuliax

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.