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

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

Reply
DanielaFerreira
Regular Visitor

Classification of columns of independence way.

Hi guys 

Could you help me with the problemy bellow?

I need classificate the thirdy colum and last colum of independece way.


The thirdy colum I classificaded by the second collum and its ok, now I need classificate the last colum by ther alfabetc order, soo I wll compare the bouth and indeticate the divergences.

 

DanielaFerreira_0-1653577635643.png

I did one exemplo in the excel where I put the result that I need

 

DanielaFerreira_1-1653577718613.png

 

Thanks

Daniela Ferreira

 

 

1 ACCEPTED SOLUTION

See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bcy5DYAwDAXQXVyniE+ODtaIsv8a+AgSBYWvryePAUgMDdDroFxJxbudoiu/YbbXUTimiAn3crby6+OwXMTMmk57HL+O8223cpsPKTcf", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [NF = _t, Qty = _t, Adress = _t, SKU = _t, #"Picking hour" = _t, #"Ordination picked" = _t, Letter = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"NF", Int64.Type}, {"Qty", Int64.Type}, {"Adress", Int64.Type}, {"SKU", Int64.Type}, {"Picking hour", type time}, {"Ordination picked", Int64.Type}, {"Letter", type text}}),
    BuffList = List.Buffer(List.Sort(#"Changed Type"[Letter])),
    FinalTable = Table.FromColumns(Table.ToColumns(#"Changed Type") & {BuffList}, Table.ColumnNames(#"Changed Type")&{"Ordination Correct"}),
    #"Added Custom" = Table.AddColumn(FinalTable, "Status", each if [Letter]=[Ordination Correct] then "Correct" else "Incorrect")
in
    #"Added Custom"

 

 

View solution in original post

5 REPLIES 5
DanielaFerreira
Regular Visitor

Hi  @Vijay_A_Verma 

How are you?

 

When I sort the last column, the others change too, Is there some way of  sort without change the others? 

 

Att

Can you give the logic for order decision?

Hi @Vijay_A_Verma 

 

Olá @Vijay_A_Verma

 

Primeiramente obrigado pela ajuda,

Estou anexando a tabela completa e vou explicar a lógica

 

O banco de dados me deu a hora exata em que o SKU (Item) foi escolhido, então criei a coluna "Ordenação escolhida"  com base na coluna "Pick hour".

Depois trouxe a coluna "Carta" de uma tabela de dimensões onde tenho a carta registrada para cada posição, a melhor posição é A, a do meio é B e a pior é a C.

Agora dupliquei a coluna "Carta" e preciso classificá-la pela ordem alfabética que é a ordem correta a ser escolhida. Finalmente vou comparar a coluna "Carta escolhida" com "ordenação correta" e descobrir se foi escolhida corretamente ou não.

 

I hope I was clear, and sorry about my bad english 

 

DanielaFerreira_0-1654090808112.png

 

See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bcy5DYAwDAXQXVyniE+ODtaIsv8a+AgSBYWvryePAUgMDdDroFxJxbudoiu/YbbXUTimiAn3crby6+OwXMTMmk57HL+O8223cpsPKTcf", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [NF = _t, Qty = _t, Adress = _t, SKU = _t, #"Picking hour" = _t, #"Ordination picked" = _t, Letter = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"NF", Int64.Type}, {"Qty", Int64.Type}, {"Adress", Int64.Type}, {"SKU", Int64.Type}, {"Picking hour", type time}, {"Ordination picked", Int64.Type}, {"Letter", type text}}),
    BuffList = List.Buffer(List.Sort(#"Changed Type"[Letter])),
    FinalTable = Table.FromColumns(Table.ToColumns(#"Changed Type") & {BuffList}, Table.ColumnNames(#"Changed Type")&{"Ordination Correct"}),
    #"Added Custom" = Table.AddColumn(FinalTable, "Status", each if [Letter]=[Ordination Correct] then "Correct" else "Incorrect")
in
    #"Added Custom"

 

 

Vijay_A_Verma
Super User
Super User

I think a simple sort on last column would give the required result. 

Do you have a reason to believe that it won't work? Let us know.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.