Forum Discussion
gmasta1129
10 months agoResolver I
Find if a date changes
Hello, I have a report that contains 3 columns 1. Run Date 2. Portfolio Code 3. Maturity Date I am trying to create a formula to show if there is a difference in the maturity date colu...
- 10 months ago
SundarRaj
10 months agoSuper User
Hi gmasta1129,
In case you'd like to do this query on Power Query. Here's a solution that you can refer to. Let me know in case there are any confusions. Thanks
Code:
let
Source = [SourceData],
Group = Table.Group(
Source,
{"facility code"},
{
{
"AllRows",
each
let
AddColumn = Table.AddIndexColumn(_, "Due Date?", 0, 1),
Transform = Table.TransformColumns(
AddColumn,
{
"Due Date?",
each try AddColumn[maturity date]{_ - 1} otherwise AddColumn[maturity date]{_}
}
),
DueColumn = Table.AddColumn(
Transform,
"Due Date",
each if [maturity date] = [#"Due Date?"] then "N" else "Y"
)
in
DueColumn
}
}
),
Combine = Table.Combine(Group[AllRows])
in
Combine