Forum Discussion

limewire's avatar
limewire
Icon for Helper I rankHelper I
7 years ago
Solved

Howto denote unstable data/create a conditional column

Really hoping someone can help me out with this one! This is what I currently have after I have "unbundled" the sections. Each element has 5 parts, unwgtd, weighted, horz %, vert % and will denote w...
  • v-cherch-msft's avatar
    7 years ago

    Hi limewire 

    You may add an index column first.Then use fill down and condition columns to get it.For example:

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlTSUQrNK08vSQEyDJVidSBC4amZ6RklqSkKzvmleSVAASO4lEd+UZWCKpBhDBcKSy0qAQtBVCUBWUCkBefALUDIY1hgDJeCW2ACF4JbYIxsAab5JrjNh0glI5tvChdC80AysgeSkS0whgthWGCKaYExpgWGyBYoxcYCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, ALL = _t]),
        #"Added Index" = Table.AddIndexColumn(Source, "Index", 1, 1),
        #"Changed Type" = Table.TransformColumnTypes(#"Added Index",{{"Column1", type text}, {"Column2", type text}, {"ALL", type text}, {"Index", Int64.Type}}),
        #"Added Conditional Column" = Table.AddColumn(#"Changed Type", "Custom", each if [ALL] = "*" then [Index] else null),
        #"Filled Down" = Table.FillDown(#"Added Conditional Column",{"Custom"}),
        #"Added Conditional Column2" = Table.AddColumn(#"Filled Down", "Custom.2", each if [Custom] = null then null else if [Index] <= [Custom] +4then "*" else null)
    in
        #"Added Conditional Column2"

    Regards,

  • limewire's avatar
    limewire
    7 years ago

    v-cherch-msft I'd like to add that it might not be necessary for the use of the asterisk, if you know another way to properly denote these unstable values (that follow the pattern of the conditional column you properly created prior), please let me know! 

  • v-cherch-msft's avatar
    v-cherch-msft
    7 years ago

    Hi limewire 

    You may change the number of decimal places as below.If you have other questions,I would suggest you create a new thread on forum so that more community members can see it and provide advice. Please remember to post dummy data and desired result.

    Regards,