Forum Discussion
Anonymous
5 years agoNot applicable
Power Query / M - If statement with Duration
Hi all, I'm looking for a bit of help converting a column built with DAX into PowerQuery. Time for next period = if('Master Append'[EndTime] > 'Master Append'[Interval End] , datediff('Mast...
- Anonymous5 years ago
solved this, seems the brackets used were not allowing me to complete the M code.
Solution was = if [EndTime] > [Interval End] then Duration.Seconds([EndTime] - [Interval End]) else 0
Anonymous
5 years agoNot applicable
Hi Anonymous ,
Your M below has not worked, but I believe it needs an if statement in there. I would expect something a bit more like "= if([EndTime] > [Interval End] then [Interval End]-[EndTime]else 0)" would be the answer I need?
Kind regards,
Jordan
Anonymous
5 years agoNot applicable
solved this, seems the brackets used were not allowing me to complete the M code.
Solution was = if [EndTime] > [Interval End] then Duration.Seconds([EndTime] - [Interval End]) else 0