4

I have seen older posts on here and other forums with the similar code to the one below and cannot figure out where a portion of it comes from.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlHSUXJ0BBJOiUXJqTn5eYlAdlhiTmpecmaiUqxOtJIpTAVcFFkxSIUZTIVvYkpRZgqQEZSfC5Eyh0mBReAqQFIW2GxGkrfEMBXVVkMDkAInfE43NIQpwel2QyOQEmesjjc0hslhut7QBCaHbDtCqymaViRbYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [ID = _t, Company = _t, Origin = _t, Destiny = _t]),
    Group = Table.Group(Source, {"Origin"}, {{"Count", each List.Count(List.Distinct(_[Destiny])), type number}, {"Destinations", each Table.FromRows({List.Distinct(_[Destiny])}), type table}}),
    AllColumnNames = Table.ColumnNames(Table.Combine(Group[Destinations])),
    #"Expanded Destinations" = Table.ExpandTableColumn(Group, "Destinations", AllColumnNames, AllColumnNames)
in
    #"Expanded Destinations"

What I cannot figure out is where the "i45WMlHSUXJ0BBJOiUXJqTn5eYlAdlhiTmpecmaiUqxOtJIpTAVcFFkxSIUZTIVvYkpRZgqQEZSfC5Eyh0mBReAqQFIW2GxGkrfEMBXVVkMDkAInfE43NIQpwel2QyOQEmesjjc0hslhut7QBCaHbDtCqymaViRbYwE=" part comes from. I know it can be from if data is manually entered but I have also seen where it can link to other data sources. I have a use case where I have calculated columns in dax but need to manipulate those calculated columns in Power Query. Is there a place where this string is stored for each data source? I understand everything after the source line but this has me stumped.

slauer12
  • 45
  • 1
  • 1
  • 7

1 Answers1

7

When you input data manually using Enter Data from the Power BI Home tab, the query it generates looks like that first line. Basically, it takes the information you put in and converts it into a compressed form that isn't human-readable to save space. That first line is decompressing it back into a table format.

You should still be able to edit that table by clicking on the little gear icon next to the first applied step in the query editor. If you edit it, that string will change.

Alexis Olson
  • 38,724
  • 7
  • 42
  • 64
  • Huh ok well that's not quite what I was hoping for. Is it possible to take calculated columns from dax and move to power query to be able to unpivot a table? – slauer12 Feb 13 '20 at 19:05
  • You can't use a calculated column from DAX in the Power query. You would have to create it as a custom column within Power query. – CR7SMS Feb 13 '20 at 19:49
  • Ok how about is there a way to unpivot in DAX? I have quite an extensive table going that is being updated all the time so I would really prefer not to have to redo everything I have already done. – slauer12 Feb 13 '20 at 19:52
  • That sounds like an entirely different question. Please submit a separate post for separate questions. – Alexis Olson Feb 13 '20 at 21:18
  • My apologies. Here is the new question: https://stackoverflow.com/questions/60230023/calculated-columns-as-axis-value – slauer12 Feb 14 '20 at 16:53