Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
can someone help me with my problem... i want to fill down my zero values become additional +1 like index until it reach value of 1 and repeat
for example i have a table like this
OK
1 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
what i expecting is become like this
OK
OK
1 |
2 |
3 |
4 |
5 |
1 |
2 |
3 |
4 |
5 |
6 |
1 |
2 |
3 |
4 |
1 |
2 |
3 |
4 |
5 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
1 |
Solved! Go to Solution.
Hi @rikofebriyan ,
For this you need to do some advance steps on the Power Query:
if[#" OK"] = 1 then [#" OK"]* 100* [Index] else null
Table.AddIndexColumn ( [RowCount], "RowNumber", 1 , 1)
Full code below:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlSK1YlWMsBB4pfFr4Zyk4khqWWOglJsLAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#" OK" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{" OK", Int64.Type}}),
#"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1, Int64.Type),
#"Added Custom" = Table.AddColumn(#"Added Index", "Custom", each if[#" OK"] = 1 then [#" OK"]* 100* [Index] else null),
#"Filled Down" = Table.FillDown(#"Added Custom",{"Custom"}),
#"Grouped Rows" = Table.Group(#"Filled Down", {"Custom"}, {{"RowCount", each _, type table [#" OK"=nullable number, Index=number, Custom=number]}}),
#"Added Custom1" = Table.AddColumn(#"Grouped Rows", "Custom.1", each Table.AddIndexColumn ( [RowCount], "RowNumber", 1 , 1)),
#"Expanded Custom.1" = Table.ExpandTableColumn(#"Added Custom1", "Custom.1", {" OK", "Index", "RowNumber"}, {"OK", "Index", "RowNumber"}),
#"Removed Columns" = Table.RemoveColumns(#"Expanded Custom.1",{"Custom", "RowCount", "Index"})
in
#"Removed Columns"
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @rikofebriyan ,
For this you need to do some advance steps on the Power Query:
if[#" OK"] = 1 then [#" OK"]* 100* [Index] else null
Table.AddIndexColumn ( [RowCount], "RowNumber", 1 , 1)
Full code below:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlSK1YlWMsBB4pfFr4Zyk4khqWWOglJsLAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#" OK" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{" OK", Int64.Type}}),
#"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1, Int64.Type),
#"Added Custom" = Table.AddColumn(#"Added Index", "Custom", each if[#" OK"] = 1 then [#" OK"]* 100* [Index] else null),
#"Filled Down" = Table.FillDown(#"Added Custom",{"Custom"}),
#"Grouped Rows" = Table.Group(#"Filled Down", {"Custom"}, {{"RowCount", each _, type table [#" OK"=nullable number, Index=number, Custom=number]}}),
#"Added Custom1" = Table.AddColumn(#"Grouped Rows", "Custom.1", each Table.AddIndexColumn ( [RowCount], "RowNumber", 1 , 1)),
#"Expanded Custom.1" = Table.ExpandTableColumn(#"Added Custom1", "Custom.1", {" OK", "Index", "RowNumber"}, {"OK", "Index", "RowNumber"}),
#"Removed Columns" = Table.RemoveColumns(#"Expanded Custom.1",{"Custom", "RowCount", "Index"})
in
#"Removed Columns"
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCheck out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
71 | |
70 | |
43 | |
31 | |
26 |
User | Count |
---|---|
89 | |
49 | |
44 | |
38 | |
37 |