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 nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi, I need some help with my M code.
I have a large table and I need to take two columns from it and turn them into one. I'm trying to accomplish this with this M code:
let
Origen = Table.Distinct(Table.SelectRows(Table.SelectColumns(VW_BT_Desembolsos,{"Solicitud_Asoc"}),each ([Solicitud_Asoc]<> 0 and [Solicitud_Asoc]<> null))),
_table_final_1 = Table.TransformColumnTypes(Origen, {{"Solicitud_Asoc", type text}}),
Origen2 = Table.SelectRows(Table.SelectColumns(VW_BT_Desembolsos,{"Solicitud_Asoc","Cuit_Producto_"}),each ([Solicitud_Asoc]= 0 or [Solicitud_Asoc]= null)),
_table_final_prev3 = Table.Distinct(Table.SelectColumns(Origen2,{"Cuit_Producto_"})),
_table_final_prev4 = Table.TransformColumnTypes(_table_final_prev3, {{"Cuit_Producto_", type text}}),
_table_final_2 = Table.RenameColumns(_table_final_prev4,{{"Cuit_Producto_", "Solicitud_Asoc"}}),
_table_final = Table.Combine({"_table_final_1","_table_final_2"})
in
_table_final
But I'm having this error:
Cannot cast value "_table_final_1" to type Table.
What am I missing?
PS: can't share my table couse confideality policy.
Thanks a lot.
Solved! Go to Solution.
You are using literal strings. You need to refer to the tables themselves.
try:
_table_final = Table.Combine({_table_final_1,_table_final_2})
You are using literal strings. You need to refer to the tables themselves.
try:
_table_final = Table.Combine({_table_final_1,_table_final_2})
Begginer mistake 😂 thansk a lot!
You're welcome. And I've made that mistake myself. Please consider marking my response as the answer.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.