Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

New table using values from two other tables

Hello,   I am working on analysing businesses' financial statements and need some help with writing DAX code to make a new table using values from another table, and names from another table. I alr...
  • FreemanZ's avatar
    FreemanZ
    3 years ago

    hi Anonymous 

    something like this?

    Table3 = 
    ADDCOLUMNS(
        SUMMARIZE(
            Table1,
            Table1[Shop Name],
            Table1[Year]
        ),
        "Total current assets",
        CALCULATE(
            SUM(Table1[Value]),
            Table2[New Name]="Total current assets"
        ),
        "Total non-current assets",
        CALCULATE(
            SUM(Table1[Value]),
            Table2[New Name]="Total non-current assets"
        ),
        "Total current liabilities",
        CALCULATE(
            SUM(Table1[Value]),
            Table2[New Name]="Total current liabilities"
        )
    )