cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors