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
MartinaV
Frequent Visitor

Cree una columna que contenga valores de otra tabla a la que hace referencia columna y fila

Tengo dos mesas:

Clientes

Customers.png

Precios

Prices.png

Me gustaría agregar una columna denominada "Precios" a la tabla Clientes. Esta columna contendría precios basados en la columna y fila respectivas de la tabla Precios mediante la tabla Presupuesto y País de la tabla Clientes.

Por ejemplo, John recibiría 10000 (ya que tiene un presupuesto bajo y compra a China), Melanie 80000 (ya que tiene un alto presupuesto y compra de los EE.UU.), Kirk 50000 (ya que tiene un presupuesto medio y compra de los EE.UU.) etc.

Cualquier idea sería bienvenida 😅

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@MartinaV

En primer lugar, desenrrecelar la segunda tabla

https://radacad.com/pivot-and-unpivot-with-power-bi

A continuación, tendrá precio país y valor en la tabla de precios, después de cambiar el nombre

Una nueva columna en el cliente

Clientes de la nueva columna : maxx(filter(Prices,Prices[price]- (Customers[budget]) && Prices[country]- (Clientes[país]) ), Precios[valor])

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@MartinaV

En primer lugar, desenrrecelar la segunda tabla

https://radacad.com/pivot-and-unpivot-with-power-bi

A continuación, tendrá precio país y valor en la tabla de precios, después de cambiar el nombre

Una nueva columna en el cliente

Clientes de la nueva columna : maxx(filter(Prices,Prices[price]- (Customers[budget]) && Prices[country]- (Clientes[país]) ), Precios[valor])

@amitchandak ¡Muchas gracias! Funciona perfectamente.

edhans
Super User
Super User

¿Puedes desenrestar tu tabla de país? Si puede, una función FILTER puede hacerlo rápidamente.

Si sus datos están en Power Query, haga clic en el campo Precios[Precio] y "Despivot other Columns"

Si no nos lo haces saber. La fórmula se vuelve mucho más compleja y menos dinámica si tiene que permanecer en el formato en el que se encuentra.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

@edhans ¡Gracias! No sabía la función de unpivot - me hace la vida mucho más fácil 😊

Gran @MartinaV: las características Pivot y UnPivot son muy útiles para transformar datos en algo útil para un modelo de Power BI.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

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.