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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors