Forum Discussion

GCH_FR's avatar
GCH_FR
Helper I
1 year ago
Solved

Generate row between two tables with criteria

Hello here   I have a problem that I would like to submit to you   My first table  CODIFICATION CODIFICATION 2 NUMERO DOCUMENT DESIGNATION DECOUPAGE PAR PROD DOC LOT EQUIVALENT APPLICA...
  • Cookistador's avatar
    1 year ago

    Hello GCH_FR 
    On your second table, you just have to select the 5 first columns and select Unpivot Other Columns

    Then you applied a filter to only return the row with value = 1

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTIFYkcgNjE19IBQQBKCY3UgSixhSiwNAyAUkDQAYyxKguFKIMpiYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"MFZ#(lf)MFZ#(lf)MFZ" = _t, PONT = _t, #"ACR OU VAT" = _t, NUMERO_ACR = _t, ACR_LOT_EQUIVALENT = _t, #"840YST" = _t, #"801YCA" = _t]),
        #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"MFZ#(lf)MFZ#(lf)MFZ", "PONT", "ACR OU VAT", "NUMERO_ACR", "ACR_LOT_EQUIVALENT"}, "Attribute", "Value"),
        #"Filtered Rows" = Table.SelectRows(#"Unpivoted Other Columns", each ([Value] = "1"))
    in
        #"Filtered Rows"

    Then 2 solutions, you click on close an applied and create a relation between your two 2 tables (many to one)

    You merge your 2 tables

     

    Let me know if you need more help to fix this issue 🙂