Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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.
Please, can anyone help me?
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
Solved! Go to Solution.
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}}),
AddSumTil30sept20 = List.Sum(Table.SelectRows(ChangedType, each [Date]<=#date(2020,9,30))[flagDay])
in
AddSumTil30sept20
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
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}}),
AddSumTil30sept20 = List.Sum(Table.SelectRows(ChangedType, each [Date]<=#date(2020,9,30))[flagDay])
in
AddSumTil30sept20
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
16 | |
9 | |
8 | |
7 | |
7 |