Forum Discussion
Condition formula for LTMD Flag
- 2 years ago
Hi Haitham_87, check this:
Result
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8irNU7DUUTAyMDJRitWJVvJNrFQwMkITMDRHFzBDEzBG4jsWFCkYWqAJYChAMaAI3U6gAkt0AQs0AWS+W2qSgpElQQEjdAFDQgKG6GZgCKDzTZH4Xol5qGEFErAklh8LAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"End Date" = _t]), ChangedType = Table.TransformColumnTypes(Source,{{"End Date", type date}}), LatestDateDay = Date.Day(List.Max(ChangedType[End Date])), Ad_LTMD = Table.AddColumn(ChangedType, "LTMD", each if LatestDateDay >= Date.Day([End Date]) then "YES" else "NO", type text) in Ad_LTMD
Hi Haitham_87 ,
// This column should be based on the logic that if the day of the maximum date in the "End Date" column is greater than or equal to the day in the subsequent cell, it should display "Yes"; otherwise, it should show "No."
Could you explain why these records also return “No”? It seems that their dates are also greater than or equal to the next date:
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group