Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Syndicate_Admin
Administrator
Administrator

Variable en columnas

Tengo 1000 países,

CountryName = "ES",
Position = List.PositionOf(List.Transform(Translate[CountryName], (x) => Text.Contains("tipo", x)), true)

¿Cómo poner CountryName como variable en la referencia de tabla? por lo que Translate[CountryName] debería obtener información del nombre de la columna ES Translate[ES]

ahora recibo un error

Expression.Error: No se encontró la columna 'CountryName' de la tabla.
Detalles:
Nombre del país

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

@Digger ,

Para establecer algo como una variable en Power Quer use let para que sea algo así como

let
  x = [Column]
in
  x //or any further transformation)                                                                                                

Los pasos adicionales después de x y antes de entrar requerirán que ese paso o variable termine con una coma, por lo que sería

let
  x = [Column],
  y = Text.Lower(x) //just a sample                                             
in
  y //or any other transformation                                                                                       

así que ofreces escribir 1000 si las declaraciones en lugar de simplemente poner variable al nombre? Necesito poner variable entre corchetes, pero no escribir declaraciones ifs de 1000s, ya que no será dinámico si aparece un nuevo countrie

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.