cancel
Showing results for 
Search instead for 
Did you mean: 
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
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.

Top Solution Authors
Top Kudoed Authors