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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Erf19
Frequent Visitor

CalculateTable - Crear filas con dos columnas y sus valores distintos

Hola

Tengo una mesa como esta:

PersonaNúmero de semanaValor

A

1100
A250
A320
B150
B310
C115
C255

Lo que quiero es tomar los valores únicos para Person y los valores únicos para Date y hacer una fila para cada par único, para crear una nueva tabla como esta:

PersonaNúmero de semana
A1
A2
A3
B1
B2
B3
C1
C2
C3

De este modo, donde, por ejemplo, la persona B no tiene una entrada para la semana 2, puedo agregar una columna de búsqueda en la nueva tabla y decir que el valor es 0.

¿Hay alguna fórmula para crear esta nueva tabla? Estoy pensando en unión, producto, resumen.... ¡No estoy seguro!

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@Erf19 - Prueba:

Table =
  GENERATE(
    DISTINCT('Table'[Person]),
    DISTINCT('Table'[Week])
  )

@ 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

2 REPLIES 2
Greg_Deckler
Super User
Super User

@Erf19 - Prueba:

Table =
  GENERATE(
    DISTINCT('Table'[Person]),
    DISTINCT('Table'[Week])
  )

@ 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...
amitchandak
Super User
Super User

@Erf19 , Probar una nueva mesa como

sindicato(
addcolumns(except(crossjoin(distinct(Table[Person]),distinct(Table[Week])), selectcolumn(Table,"Person",[Person],"Week",[Week])),"Number Value",0),
Mesa)

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.