Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
Hello!
Could you please help me with this, I have many columns ( [Source.file], [time], [serie], [Altitude], etc). I just want copy the previous row altitude to the current row in a new column: [Altura0], based on the previous [time]
I am getting this error :
Expression.Error: No se puede convertir el valor #datetime(2021, 2, 6, 22, 16, 9) al tipo Text.
Detalles:
Value=6/02/2021 22:16:09
Type=[Type]
I don't know what to do 😭 I am new on M language.
Please see the code in Bold (that's what i wrote).⬇️
Please!! and thank you!
---------------------------
#"Rango de texto insertado" = Table.AddColumn(#"Tipo cambiado", "Rango de texto", each Text.Middle([Source.Name], 20, 6), type text),
#"Data Logger Source" = Table.RenameColumns(#"Rango de texto insertado",{{"Rango de texto", "Serie"}}),
#"Personalizada agregada" = Table.AddColumn(#"Data Logger Source", "Altura0", each let
#"serie actual" = [Serie],
#"tiempo actual" = [Time],
#"ciclo total serie" = Table.SelectRows(#"Data Logger Source", each [Serie] = #"serie actual"),
#"ciclo tiempo" = Table.SelectRows(#"ciclo total serie", each [Time] < #"tiempo actual"),
#"max time anterior" = if not Table.IsEmpty(#"ciclo tiempo") then List.Max(Table.Column(#"ciclo tiempo", [Time]), 0) else 0,
#"max time" = Text.From(#"max time anterior")
#"Altura anterior" = if #"max time"<> 0 then Table.Column(Table.SelectRows(#"ciclo tiempo", each Text.From([Time]) = #"max time"), [#"Altitude[m]"]) else 0
in
#"Altura anterior", type number)
Hi @Anonymous ,
I found some similar posts, please kindly refer to
[Expression.Error] We cannot convert the value #date(2017, 4, 3) to Type Text
Expression.Error: We cannot convert the value to type Text.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
It's not clear what your "in" statement ends up evaluating to, but that is not your question; it looks like in your "max time" statement, you change [Time] to type text, but then you have if #"max time" <> 0, where it should instead be:
if #"max time" <> "0"
The zero should be a text value for that statement.
--Nate
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 5 | |
| 4 | |
| 4 |