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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
samsha786
Helper I
Helper I

DAX NATURALINNERJOIN

Mi código:

Asignaciones de recursos ?
VAR AssignedCapacityWeighted ?
SELECTCOLUMNS(
SUMMARIZECOLUMNS(
'Recursos del proyecto'[ResourceId],
'Recursos del proyecto',
"Capacidad asignada ponderada",
SUMX('Recursos del proyecto', (('DATEDIFF('Project Resources'[Assigned Start Date], 'Project Resources'[Assigned End Date], DAY)) * 'Project Resources'[Assigned Capacity]) / 365.0)),
"Id", 'Project Resources'[ResourceId],
"Capacidad asignada ponderada", [Capacidad asignada ponderada]
)
DONDE ChapterTeamsFullName ?
SUMMARIZECOLUMNS(
'Equipos (Personas)'[Id],
«Equipos (Personas)»[Capítulo],
'Equipos (Personas)'[Equipo],
'Equipos (Personas)'[Nombre Completo])
VAR ResourceAllocationParts ?
NATURALINNERJOIN(ChapterTeamsFullName, AssignedCapacityWeighted)
RETURN ResourceAllocationParts
No se han detectado columnas de combinación comunes... ¿Por qué no sabe que ResourceId renombrado a Id es el mismo que Id de las dos tablas que creé? ¿Qué tengo que hacer para que entienda esto? En mis modelos existentes ya se han creado relaciones.
4 REPLIES 4
amitchandak
Super User
Super User

NATURALINNERJOIN según la documentación

Columns being joined on must have the same data type in both tables.

Only columns from the same source table (have the same lineage) are joined on. For example, Products[ProductID], WebSales[ProductdID], StoreSales[ProductdID] with many-to-one relationships between WebSales and StoreSales and the Products table based on the ProductID column, WebSales and StoreSales tables are joined on [ProductID].

https://docs.microsoft.com/en-us/dax/naturalinnerjoin-function-dax

Consulte cómo utilizar : https://www.youtube.com/watch?v=mcQ_ZmuWvDs&vl=en

hay una opción costosa

filter(crossjoin(table1,table2), Table1[A]-Table2[B])

Intente en editar consulta

https://radacad.com/append-vs-merge-in-power-bi-and-power-query

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

No es una respuesta completa, pero fue suficiente para que me moviera en la dirección correcta.

Ok, Así que lo hice un paso más allá... casi lo que necesito, código a continuación:

Asignaciones de recursos ?
VAR AssignedCapacityWeighted ?
SELECTCOLUMNS(
SUMMARIZECOLUMNS(
'Project Resources'[ResourceId], 'Project Resources'[Assigned End Date]. [Año], 'Recursos del proyecto',
"Capacidad asignada ponderada", SUM('Project Resources'[Assigned Capacity Weighted]), "Year", MIN('Project Resources'[Assigned End Date].[ Año])
),
"ResourceId", 'Project Resources'[ResourceId] & " ",
"Capacidad asignada ponderada", [Capacidad asignada ponderada], "Año", [Año]
)
DONDE ChapterTeamsFullName ?
SELECTCOLUMNS('Equipos (Personas)', "Id", 'Equipos (Personas)'[Id],
"ResourceId", 'Teams (People)'[Id] & " ",
"Capítulo", 'Equipos (Personas)'[Capítulo],
"Equipo", 'Equipos (Personas)'[Equipo],
"Full Name", 'Teams (People)'[Nombre completo])
VAR ResourceAllocationParts ?
NATURALLEFTOUTERJOIN(ChapterTeamsFullName, AssignedCapacityWeighted)
RETURN ResourceAllocationParts
Salida:
Picture.png
Esperando un único registro con Capacidad ponderada asignada, 95%. ¿Qué me estoy perdiendo? Si no agrupo por año, entonces funciona perfectamente.
Greg_Deckler
Community Champion
Community Champion

Esa función puede ser bastante tempermental. Necesitaría datos de origen para intentar replicar:

Por favor, consulte este post sobre cómo obtener su pregunta respondida rápidamente: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Kudoed Authors