cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Anonymous
Not applicable

## Sum IF power query

Formula that some the value of flagDia until the day in question. Ex .: until the 7th the value must be 5, 8th = 5, 9th = 5, 10th = 6.

ex.: Sum( flagDay, Data <= data)

Formula that some the value of flagDia until the day in question. Ex .: until the 7th the value must be 5

1 ACCEPTED SOLUTION
Community Champion

hello @Anonymous

check out this solution. Use Table.SelectRows to filter the table, then you reference the column and use the List.Sum-function to sum that column

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjLVM7DUMzJQ0lEyUIrVAQpYoAtYwgUMwQLGBmgCBoZ6hgYoAkboAiboAqZwAYgtBmbIKmIB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, flagDay = _t]),
ChangedType = Table.TransformColumnTypes(Source,{{"Date", Date.Type, "de-DE"}, {"flagDay", Int64.Type}}),
in

Copy paste this code to the advanced editor in a new blank query to see how the solution works.

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

Community Champion

hello @Anonymous

check out this solution. Use Table.SelectRows to filter the table, then you reference the column and use the List.Sum-function to sum that column

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjLVM7DUMzJQ0lEyUIrVAQpYoAtYwgUMwQLGBmgCBoZ6hgYoAkboAiboAqZwAYgtBmbIKmIB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, flagDay = _t]),
ChangedType = Table.TransformColumnTypes(Source,{{"Date", Date.Type, "de-DE"}, {"flagDay", Int64.Type}}),
in

Copy paste this code to the advanced editor in a new blank query to see how the solution works.

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

#### Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors