This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowJuly 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more
Hi all,
I'm looking for a bit of help converting a column built with DAX into PowerQuery.
Solved! Go to Solution.
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
I don't know the DAX sintax at all, but for what I can understand, would suggest to try this:
#"Time for next period" =List.Max({Duration.Seconds(#"Master Append"[Interval End]-#"Master Append"[EndTime]),0}
If you want, as seems from picture, add a new column with this data you shoul put the left right of the expression on the tool
add custom tool
@Anonymous no luck unfortunately
could you explain better what you mean by no lucky?
if you want useful help, you have to provide maximum information, otherwise it is difficult to imagine what happens
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
Hi @Anonymous
you didn't explained what error my code raises.
The logic of the expression I give is the same of your if ... then .. else. Only written in a differente way.
But now I have seen an error in the sintax
this
List.Max({Duration.Seconds(#"Master Append"[Interval End]-#"Master Append"[EndTime]),0}
should be
List.Max({Duration.Seconds(#"Master Append"[Interval End]-#"Master Append"[EndTime],0})
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
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Check out the July 2026 Power BI update to learn about new features.