cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User I
Super User I

Alternativa de NATURALLEFTOUTERJOIN en una tabla temporal (consulta DAX)

¿Hay alguna alternativa de NATURALLEFTOUTERJOIN en una tabla temporal ... si es así, desea probar el rendimiento imapct con la alternativa. La ayuda de ANy es apreciada !!!

LOOKUPVALUE no funcionará en una tabla temporal.

Por ejemplo, Consulta

Table = 
    VAR _1 = DATATABLE (
        "ID", STRING,
        "BU", STRING,
        "YEAR", INTEGER,
        "Month", INTEGER,
        {
            { "BU1-2019-1", "BU-1", 2019, 1 },
            { "BU1-2019-2", "BU-1", 2019, 2 },
            { "BU1-2019-3", "BU-1", 2019, 3 }
        }
    )
VAR _2 = DATATABLE (
        "ID", STRING,
        "Actual", INTEGER,
        {
            { "BU1-2019-1", 100 },
            { "BU1-2019-2", 200 },
            { "BU1-2019-3", 300 }
        }
    )
VAR _3 = NATURALLEFTOUTERJOIN(_1,_2)
RETURN _3


New Animated Dashboard: Sales Calendar


1 REPLY 1
Highlighted
Community Support
Community Support

Hola @smpa01

Por favor, compruebe a continuación:

Table 3 = 
VAR _1 =
    DATATABLE (
        "ID", STRING,
        "BU", STRING,
        "YEAR", INTEGER,
        "Month", INTEGER,
        {
            { "BU1-2019-1", "BU-1", 2019, 1 },
            { "BU1-2019-2", "BU-1", 2019, 2 },
            { "BU1-2019-3", "BU-1", 2019, 3 }
        }
    )
VAR _2 =
    DATATABLE (
        "ID", STRING,
        "Actual", INTEGER,
        {
            { "BU1-2019-1", 100 },
            { "BU1-2019-2", 200 },
            { "BU1-2019-3", 300 }
        }
    )
VAR _3 =
    SELECTCOLUMNS ( _2, "ID", [ID] )
RETURN
    ADDCOLUMNS (
        FILTER ( _1, [ID] IN _3 ),
        "Actual", VAR i = [ID] RETURN SUMX ( FILTER ( _2, [ID] = i ), [Actual] )
    )

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors