Forum Discussion
Howto denote unstable data/create a conditional column
- 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,
- 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!
- 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,
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,
v-cherch-msft Thank you so very much for your response!!!
I tried my best to follow your instructions but still have not succeeded in my mission.
Following your instructions, I was able to get the pattern I requested. Using that, in the data model view, I added a calculated column that was able to combine the symbols ("Custom 1" column) to the values ("All" column). Yet when I attempted to rank it by the calculated column (I named the column Sigfig"), it is clear that it is not in the proper order.
Is there any way to rectifyy this?
And is there a way to make the numbers rounded to the nearest hundredths place?
Again thank you so much for your help!!