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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Stevefranck
Frequent Visitor

classify according row

hello , 

I need our help please ! 

Descriptions        

location GabaritBrandNewBrand
T1A256DAother
T1D456DIDI
T1F5335DAother
T2C5679DAother
T2D5678DIDI
T2F6543DAother
T3D07766DIDI
T3F755DAother
T3H6567DAother
T4D643DIDI
T4G665DAother
T5D543DIDI
T6D098DIDI
T6Z5433DAother
T6E9876DADI
T7F567DADA
T8S654DADA
T9D986DIDI
T10A285DADA
T11O943DADA

  

For start i have for information Location , Gabarit , Brand 

For the same Location if we have several Gabarit and one of the Gabarit starts with "D" then the new Brand  will be "DI" and the rest of the Gabarit of the same Location will have as new Brand "Other"

If for a Location we have no Gabarit starting with "D" then the new brand will be unchanged

Thank you for your help.

1 ACCEPTED SOLUTION

@Stevefranck Good to know it solved your problem. Kindly mark my solution as accepted solution so that it will help other to find it more quickly. 😊

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

4 REPLIES 4
Samarth_18
Community Champion
Community Champion

Hi @Stevefranck ,

 

Please try this:-

New Brand =
VAR _count =
    CALCULATE (
        COUNT ( 'Table (2)'[location ] ),
        FILTER (
            ALL ( 'Table (2)' ),
            'Table (2)'[location ] = EARLIER ( 'Table (2)'[location ] )
        )
    )
VAR _gabrit =
    IF ( LEFT ( 'Table (2)'[Gabarit], 1 ) = "D", "DI", "other" )
RETURN
    IF ( _count = 1, 'Table (2)'[Brand], _gabrit )

 

output:-

Samarth_18_0-1644933912824.png

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Hello,

Thank you very much, it works very well

 

Steve.

@Stevefranck Good to know it solved your problem. Kindly mark my solution as accepted solution so that it will help other to find it more quickly. 😊

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Hello ,

I come back to you.

How can I change the code if we add a time concept as in the table?
That is, if for a "DA"  in Brand we have more than 5 months difference with the "DI" then we keep "DA" otherwise it will be "other" in the newBrand?

LocationGabaritBrandDateNewBrand
T1A256DA01/06/2022DA
T1D456DI01/01/2022DI
T1F5335DA26/02/2022other
T2C5679DA05/05/2022DA
T2D5678DI04/11/2021DI
T2F6543DA16/01/2022other
T3D07766DI10/11/2021DI
T3F755DA19/07/2022DA
T3H6567DA18/11/2021other
T4D643DI09/11/2021DI
T4G665DA08/09/2022DA
T5D543DI02/02/2022DI
T6D098DI19/03/2022DI
T6Z5433DA20/03/2022DI
T6E9876DA15/04/2022DI
T7F567DA20/02/2022DA
T8S654DA19/01/2021DA
T9D986DI20/01/2021DI
T10A285DA21/01/2021DA
T11O943DA22/01/2021DA

Thank you for returning

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.