Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!View all the Fabric Data Days sessions on demand. View schedule
How do i get this logic to excluded rows with Zero?
List.Average(Table.SelectRows(
DaysonHandData,
(InnerTable) => InnerTable[Product] = [Product])[Daily Average])
Solved! Go to Solution.
Hi @Anonymous ,
You can try to add a filter in Table.SelectRows.
List.Average(Table.SelectRows(
DaysonHandData,
(InnerTable) => InnerTable[Product] = [Product] and [Daily Average] <>0)[Daily Average])
Here I create a sample to have a test.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTJWitWBsAzgLBM4yxTMcoKLOcHVobLMlGJjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Product = _t, #"Daily Average" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Product", type text}, {"Daily Average", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom",
each
let _Product = [Product] in
List.Average(
Table.SelectRows(
#"Changed Type",
each _Product =[Product]and [Daily Average] <>0 )[Daily Average]))
in
#"Added Custom"
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Do i get rid of all the other code?
List.Average(Table.SelectRows(
DaysonHandData,
(InnerTable) => InnerTable[Product] = [Product])[Daily Average])
Hi @Anonymous ,
You can try to add a filter in Table.SelectRows.
List.Average(Table.SelectRows(
DaysonHandData,
(InnerTable) => InnerTable[Product] = [Product] and [Daily Average] <>0)[Daily Average])
Here I create a sample to have a test.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTJWitWBsAzgLBM4yxTMcoKLOcHVobLMlGJjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Product = _t, #"Daily Average" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Product", type text}, {"Daily Average", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom",
each
let _Product = [Product] in
List.Average(
Table.SelectRows(
#"Changed Type",
each _Product =[Product]and [Daily Average] <>0 )[Daily Average]))
in
#"Added Custom"
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!