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
Barry_PL
New Member

Count duplicates and add description based on index

Hi,
I'm strugling with issue with column in PowerBi that count duplicates and adding description ("cumulatively with values")

When in column Code will be duplicates then add text that "cumulates" values in column Description

in index 1 and 2 there is duplicates in Code column - in first row in Description column there is only 1 text

in 2 row there is description from 1 row and after comma description from 2 row.

and same logic should be in 3,4,5 row (3 duplicates in Code column)
 

 

No.CodeCustomer agreementDescription
1590123ABCCode: 590123 with customer aggrement ABC
2590123DEFCode: 590123 with customer aggrement ABC, Code: 590123 with customer aggrement DEF
3587777   XXX                           Code: 587777 with customer aggrement XXX
4587777   YYY                           Code: 587777 with customer aggrement XXX,Code: 587777 with customer aggrement YYY
5587777   ZZZ                         Code: 587777 with customer aggrement XXX, Code: 587777 with customer aggrement YYY, Code: 587777 with customer aggrement ZZZ


Someone can help ?
Thank You in advance

1 ACCEPTED SOLUTION
Bmejia
Solution Specialist
Solution Specialist

Try this 
 
Description =
VAR ThisID =YourTable[No.]
RETURN
"Code: " & YourTable[Code] & " with customer agreement " &
    CONCATENATEX(
        FILTER(
            'YourTable',
            YourTable[No.] <=ThisID
            && YourTable[Code] =EARLIER(YourTable[Code])
        ),
        YourTable[Customer agreement],
        ", Code: " &  YourTable[Code] &" with customer agreement " ,
        YourTable[Code]
        )

View solution in original post

2 REPLIES 2
Barry_PL
New Member

Code is working
THANK YOU!

Bmejia
Solution Specialist
Solution Specialist

Try this 
 
Description =
VAR ThisID =YourTable[No.]
RETURN
"Code: " & YourTable[Code] & " with customer agreement " &
    CONCATENATEX(
        FILTER(
            'YourTable',
            YourTable[No.] <=ThisID
            && YourTable[Code] =EARLIER(YourTable[Code])
        ),
        YourTable[Customer agreement],
        ", Code: " &  YourTable[Code] &" with customer agreement " ,
        YourTable[Code]
        )

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.