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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
smpa01
Super User
Super User

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

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
1 REPLY 1
v-diye-msft
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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors