Forum Discussion
bballjoe12
5 years agoFrequent Visitor
Help with Syntax to keep rows if date is not modified within 48 hours?
I'm new to Power BI and trying to use the Advanced Editor and add syntax to keep the rows if the last modified date is not within the last 48 hours. Here is my code so far: let
Source = #...
- Anonymous5 years ago
try this ( I modified your script by adding the expression that checks if [target data] is before the last 48 hours )
let Source = #"Ticket Data", #"Null Target Date" = Table.SelectRows(#"Source", each [Target Date] = null or (not DateTime.IsInPreviousNHours([Target Date],48 ))), #"Changed Type" = Table.TransformColumnTypes(#"Null Target Date",{{"Submitted Date", type datetime}, {"Last Modified Date", type datetime}, {"Target Date", type datetime}}) in #"Changed Type"
bballjoe12
5 years agoFrequent Visitor
Thank you for this! How do I go about getting this configured? Do I need to add this table? How do I then compare my column of "Last Modified Date?"
- Anonymous5 years agoNot applicable
try this ( I modified your script by adding the expression that checks if [target data] is before the last 48 hours )
let Source = #"Ticket Data", #"Null Target Date" = Table.SelectRows(#"Source", each [Target Date] = null or (not DateTime.IsInPreviousNHours([Target Date],48 ))), #"Changed Type" = Table.TransformColumnTypes(#"Null Target Date",{{"Submitted Date", type datetime}, {"Last Modified Date", type datetime}, {"Target Date", type datetime}}) in #"Changed Type"