Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
EserB
Regular Visitor

Add Custom Column with condutions of dublicate value

Hello, 

My Data has the columns named "Issue ID" and "Brand". I want to add column to data named " Brand Overlapping" for the conditions below:

1-) If a Issue ID has both of Brand A and Brand B then Brand Overlapping = A & B Together

2-) If a Issue ID has only Brand A  then Brand Overlapping = Only A

3-) If a Issue ID has only Brand B  then Brand Overlapping = Only B

 

How can I add this column? 

Appricate if you help for this issue 😞

 

Issue IdBrandBrand Overlapping
1AA & B Together
1CA & B Together
1BA & B Together
2AOnly A
2AOnly A
3BOnly B
3COnly B
4AA & B Together
4BA & B Together
1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a new column.

 

Jihwan_Kim_0-1705814571931.png

 

 

Brand Overlapping CC =
VAR _issue = Data[Issue Id]
VAR _t =
    FILTER ( Data, Data[Issue Id] = _issue )
RETURN
    SWITCH (
        TRUE (),
        COUNTROWS ( FILTER ( _t, Data[Brand] = "A" ) ) >= 1
            && COUNTROWS ( FILTER ( _t, Data[Brand] = "B" ) )
                = BLANK (), "Only A",
        COUNTROWS ( FILTER ( _t, Data[Brand] = "A" ) )
            = BLANK ()
            && COUNTROWS ( FILTER ( _t, Data[Brand] = "B" ) ) >= 1, "Only B",
        COUNTROWS ( FILTER ( _t, Data[Brand] = "A" ) ) >= 1
            && COUNTROWS ( FILTER ( _t, Data[Brand] = "B" ) ) >= 1, "A & B Together"
    )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

3 REPLIES 3
EserB
Regular Visitor

Hi, 

It works perfectly. I'm appreciate very much. Thank you 🙏

ThxAlot
Super User
Super User

ThxAlot_1-1705817821054.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a new column.

 

Jihwan_Kim_0-1705814571931.png

 

 

Brand Overlapping CC =
VAR _issue = Data[Issue Id]
VAR _t =
    FILTER ( Data, Data[Issue Id] = _issue )
RETURN
    SWITCH (
        TRUE (),
        COUNTROWS ( FILTER ( _t, Data[Brand] = "A" ) ) >= 1
            && COUNTROWS ( FILTER ( _t, Data[Brand] = "B" ) )
                = BLANK (), "Only A",
        COUNTROWS ( FILTER ( _t, Data[Brand] = "A" ) )
            = BLANK ()
            && COUNTROWS ( FILTER ( _t, Data[Brand] = "B" ) ) >= 1, "Only B",
        COUNTROWS ( FILTER ( _t, Data[Brand] = "A" ) ) >= 1
            && COUNTROWS ( FILTER ( _t, Data[Brand] = "B" ) ) >= 1, "A & B Together"
    )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.