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
o59393
Post Prodigy
Post Prodigy

Cómo crear una tabla maestra a partir de una tabla existente

Hola a todos

Necesito crear una tabla "Master" que contenga el catálogo de los productos únicos y su respectiva marca, categoría y segmento.

Las columnas se almacenan en una tabla denominada Query1 con muchos duplicados para todas estas columnas:

query111.PNG

Hasta ahora sólo podía obtener la columna De v Producto con este dax:

Beverage Product Table = 

  DISTINCT(


      SELECTCOLUMNS('Query1',"Beverage Product",Query1[[L1.3 - Bev Product]]])
   
)

El resultado esperado que quiero es el siguiente:

https://1drv.ms/x/s!ApgeWwGTKtFdhkwiJCQdCuXi-bp0?e=jkMLfT

¡Gracias!

1 ACCEPTED SOLUTION

Master Table = 

SUMMARIZE(
  'Query1',
  'Query1'[L1.3 - Bev Product]], 
  'Query1'[L1.4 - Brand]], 
  'Query1'[L1.7 - Bev Category], 
  'Query1'[L1.8 - Bev Segment]
)

A menos que los nombres de las columnas tengan corchetes en sus nombres, entonces necesitaría sus corchetes dobles.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

7 REPLIES 7
Greg_Deckler
Super User
Super User

En DAX, utilice SUMMARIZE o GROUPBY. En Power Query, use Agrupar por.

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hola @Greg_Deckler

¿Así?

Master Table = 
DISTINCT(
SUMMARIZE( Query1, Query1[[L1.3 - Bev Product]]],Query1[[L1.4 - Brand]]],Query1[[L1.7 - Bev Category]]],Query1[[L1.8 - Bev Segment]]])
)

¡Gracias!

Aparte de que no debería necesitar el DISTINCT no creo, pero podría estar equivocado.

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hola @Greg_Deckler

Quiero que esté en Dax, ya que será una mesa nueva.

¿Cuál debería ser la orden?

Master Table = 

SUMMARIZE(
(Query1,
  DISTINCT(
    SELECTCOLUMNS('Query1',"Beverage Product",Query1[[L1.3 - Bev Product]]]), 
    SELECTCOLUMNS('Query1',"Brand",Query1[[L1.4 - Brand]]], 
    SELECTCOLUMNS('Query1',"Beverage Category",Query1[[L1.7 - Bev Category]]], 
    SELECTCOLUMNS('Query1',"Beverage Segment",Query1[[L1.8 - Bev Segment]]], 
)

Lo hice, pero no lo está leyendo.

Gracias.

Master Table = 

SUMMARIZE(
  'Query1',
  'Query1'[L1.3 - Bev Product]], 
  'Query1'[L1.4 - Brand]], 
  'Query1'[L1.7 - Bev Category], 
  'Query1'[L1.8 - Bev Segment]
)

A menos que los nombres de las columnas tengan corchetes en sus nombres, entonces necesitaría sus corchetes dobles.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Gracias 😄@Greg_Deckler

Usé el distinct para evitar duplicados en el nombre del producto de bebida.


Funcionó.

¡Aprecia tu ayuda!

¡Gran! La razón por la que no pensé que DISTINCT debería ser necesario es que RESUME debe encargarse de eso por sí mismo especificando el nombre del producto como un grupo por columna.

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.