Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Power Query help
count number of repeating values in "Source-gNB" column and add "Count" column with the count.
S_NodeId | S_Cell | Source-gNB | travelDistance | count |
London | NewYork | MNJ06941A2_231-A_520110 | 3.961 | 2 |
Solved! Go to Solution.
@PSB OK, here's a Power Query solution as well. Add a custom column with this formula:
let
SourceGNB = [#"Source-gNB"],
Count = Table.RowCount(Table.SelectRows(#"Changed Type", each [#"Source-gNB"] = SourceGNB))
in
Count
Here is the full query from Advanced Editor:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("pZAxDoAgDEXvwoyE30KVkVWjFyCE+99CiYkaXCQOHX5++/rblNS6zVaCQySlVbwEDnVbhRhDLJ4sYA+HTZDaQSrrrwhx4xNBhrsRTYovCH4hZFgKSFyoiFroSMCj7xlHM+4w/dnevFCMZT7vzzs=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [S_NodeId = _t, S_Cell = _t, #"Source-gNB" = _t, travelDistance = _t, count = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"S_NodeId", type text}, {"S_Cell", type text}, {"Source-gNB", type text}, {"travelDistance", type number}, {"count", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each let
SourceGNB = [#"Source-gNB"],
Count = Table.RowCount(Table.SelectRows(#"Changed Type", each [#"Source-gNB"] = SourceGNB))
in
Count)
in
#"Added Custom"
@PSB OK, here's a Power Query solution as well. Add a custom column with this formula:
let
SourceGNB = [#"Source-gNB"],
Count = Table.RowCount(Table.SelectRows(#"Changed Type", each [#"Source-gNB"] = SourceGNB))
in
Count
Here is the full query from Advanced Editor:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("pZAxDoAgDEXvwoyE30KVkVWjFyCE+99CiYkaXCQOHX5++/rblNS6zVaCQySlVbwEDnVbhRhDLJ4sYA+HTZDaQSrrrwhx4xNBhrsRTYovCH4hZFgKSFyoiFroSMCj7xlHM+4w/dnevFCMZT7vzzs=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [S_NodeId = _t, S_Cell = _t, #"Source-gNB" = _t, travelDistance = _t, count = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"S_NodeId", type text}, {"S_Cell", type text}, {"Source-gNB", type text}, {"travelDistance", type number}, {"count", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each let
SourceGNB = [#"Source-gNB"],
Count = Table.RowCount(Table.SelectRows(#"Changed Type", each [#"Source-gNB"] = SourceGNB))
in
Count)
in
#"Added Custom"
@PSB Well, of course the DAX for this is trivial but I suppose you want it in Power Query?
Count DAX =
VAR __SNodeId = [S_NodeId]
VAR __SCell = [S_Cell]
VAR __SourcegNB = [Source-gNB]
RETURN
COUNTROWS(FILTER('Table',[S_NodeId] = __SNodeId && [S_Cell] = __SCell && [Source-gNB] = __SourcegNB ))
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
93 | |
89 | |
83 | |
75 | |
49 |
User | Count |
---|---|
142 | |
140 | |
110 | |
69 | |
55 |