Forum Discussion

BarbaraK's avatar
BarbaraK
New Member
6 years ago
Solved

DAX Calculated Column needed in Query for join

I have query data "Weekly Sales" that looks a bit like this (changed for confidentiality):   Code Desc Qty Index   Debtor: XYZ Debtor   1 1010 Product 1 12 2 1020 Product 2 3...
  • parry2k's avatar
    6 years ago

    BarbaraK in query editor start a blank query and paste the following code and you will see the step on how to create one

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WUtJRcklNKskvslKIiIxSgLCBgkBkqBSrE61kaGBoAOQEFOWnlCaXKBiCJIyAhBFU1ghZFiRhDMYQSWNkSZCECRiDJJEsDggKQbHYFJfFJiDtZrgsNjMDEua4bAZhC6XYWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Code = _t, Desc = _t, Qty = _t, Index = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Code", Int64.Type}, {"Desc", type text}, {"Qty", Int64.Type}, {"Index", Int64.Type}}),
        #"Added Custom" = Table.AddColumn(#"Changed Type", "Location", each if [Code] = null then [Desc] else null),
        #"Filled Down" = Table.FillDown(#"Added Custom",{"Location"})
    in
        #"Filled Down"