Forum Discussion
Anonymous
5 years agoNot applicable
Need Help : Expression Error: We cannot apply field access to the type function
I am trying to create a column with M- Query to convert a time field in the text to regular time in addition to converting it from UTC to IST. Using the query underneath. However, getting an error of...
- 5 years ago
Table.AddColumn(#"Changed Type", "Dep Time (IST)", each if Text.Length([#"Dept Time[UTC]"])=4 then Text.Start([#"Dept Time[UTC]"],2)&":"&Text.End([#"Dept Time[UTC]"],2) else if Text.Length([#"Dept Time[UTC]"])=3 then Text.Start([#"Dept Time[UTC]"],1)&":"&Text.End([#"Dept Time[UTC]"],2) else if Text.Length([#"Dept Time[UTC]"])=2 then "00"&":"&Text.End([#"Dept Time[UTC]"],2) else "00:00")
wdx223_Daniel
Community Champion
5 years agoTable.AddColumn(#"Changed Type", "Dep Time (IST)", each if Text.Length([#"Dept Time[UTC]"])=4 then Text.Start([#"Dept Time[UTC]"],2)&":"&Text.End([#"Dept Time[UTC]"],2) else if Text.Length([#"Dept Time[UTC]"])=3 then Text.Start([#"Dept Time[UTC]"],1)&":"&Text.End([#"Dept Time[UTC]"],2) else if Text.Length([#"Dept Time[UTC]"])=2 then "00"&":"&Text.End([#"Dept Time[UTC]"],2) else "00:00")