Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
In the following table, I want to add 2 new columns with name Overdue and due in 90 days) with values true or false. How Can I do that ?
| Document Type | Latest Date |
| Certificate 1 | 3/1/2022 |
| Certificate 2 | 1/31/2024 |
| Layout Design | 7/1/2022 |
| Statement 1 | 7/1/2022 |
| Statement 2 | 3/1/2022 |
| Processes Description | 10/1/2024 |
| Flow Diagram | 10/1/2024 |
| Floor Plan | 7/1/2022 |
| Schedule 1 | 1/31/2024 |
| Schedule 2 | 7/1/2022 |
| List 1 | 7/1/2022 |
| List 2 | 7/1/2022 |
| Schedule A | 3/1/2022 |
| Schedule Y | 3/1/2022 |
| Schedule G | 3/1/2022 |
Solved! Go to Solution.
Put following formulas
For Overdue
= Date.From(DateTime.FixedLocalNow())>[Latest Date]
For Due in 90 days
= Date.IsInNextNDays([Latest Date],90)See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test (later on when you use the query on your dataset, you will have to change the source appropriately. If you have columns other than these, then delete Changed type step and do a Changed type for complete table from UI again)
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("dc89C8IwEAbgvxIyF9KkgrNYdOlQcJLSIcSzHrSNJCnivzeNEPq55sm9d29V0TMYh09U0gHhNKEZ40ykQtA6maPwyFkW9BC0kF89OJKDxab3epyO3pwf6qB3IXWHxHJhabQCa8GOqcrg26Eeo3nKJosvrf6QHGVjZLeF2pCyleuT1AseQ/vvOa8SSSyHCrQbFcLr6m9MOS17RbnvynUm9Q8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Document Type" = _t, #"Latest Date" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Document Type", type text}, {"Latest Date", type date}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Overdue", each Date.From(DateTime.FixedLocalNow())>[Latest Date]),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Due in 90 days", each Date.IsInNextNDays([Latest Date],90))
in
#"Added Custom1"
Put following formulas
For Overdue
= Date.From(DateTime.FixedLocalNow())>[Latest Date]
For Due in 90 days
= Date.IsInNextNDays([Latest Date],90)See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test (later on when you use the query on your dataset, you will have to change the source appropriately. If you have columns other than these, then delete Changed type step and do a Changed type for complete table from UI again)
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("dc89C8IwEAbgvxIyF9KkgrNYdOlQcJLSIcSzHrSNJCnivzeNEPq55sm9d29V0TMYh09U0gHhNKEZ40ykQtA6maPwyFkW9BC0kF89OJKDxab3epyO3pwf6qB3IXWHxHJhabQCa8GOqcrg26Eeo3nKJosvrf6QHGVjZLeF2pCyleuT1AseQ/vvOa8SSSyHCrQbFcLr6m9MOS17RbnvynUm9Q8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Document Type" = _t, #"Latest Date" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Document Type", type text}, {"Latest Date", type date}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Overdue", each Date.From(DateTime.FixedLocalNow())>[Latest Date]),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Due in 90 days", each Date.IsInNextNDays([Latest Date],90))
in
#"Added Custom1"
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 5 | |
| 5 | |
| 3 |