Forum Discussion
Stevefranck
4 years agoFrequent Visitor
classify according row
hello , I need our help please ! Descriptions location Gabarit Brand NewBrand T1 A256 DA other T1 D456 DI DI T1 F5335 DA other T2 C5679 DA other T2 D56...
- 4 years ago
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. 😊
Samarth_18
4 years agoCommunity 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:-
Thanks,
Samarth
Stevefranck
4 years agoFrequent Visitor
Hello,
Thank you very much, it works very well
Steve.
- Samarth_184 years agoCommunity Champion
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. 😊
- Stevefranck4 years agoFrequent Visitor
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?Location Gabarit Brand Date NewBrand T1 A256 DA 01/06/2022 DA T1 D456 DI 01/01/2022 DI T1 F5335 DA 26/02/2022 other T2 C5679 DA 05/05/2022 DA T2 D5678 DI 04/11/2021 DI T2 F6543 DA 16/01/2022 other T3 D07766 DI 10/11/2021 DI T3 F755 DA 19/07/2022 DA T3 H6567 DA 18/11/2021 other T4 D643 DI 09/11/2021 DI T4 G665 DA 08/09/2022 DA T5 D543 DI 02/02/2022 DI T6 D098 DI 19/03/2022 DI T6 Z5433 DA 20/03/2022 DI T6 E9876 DA 15/04/2022 DI T7 F567 DA 20/02/2022 DA T8 S654 DA 19/01/2021 DA T9 D986 DI 20/01/2021 DI T10 A285 DA 21/01/2021 DA T11 O943 DA 22/01/2021 DA Thank you for returning