Forum Discussion

Nerf_Herder's avatar
Nerf_Herder
Frequent Visitor
2 years ago
Solved

Create a table using DAX

Hi,  I need to create a calculated table based on which customer name is manually added to a CustomerKeyFilter. I'm trying to add three columns from table1 [CustomerKey], [QuestionId], [Answer] and...
  • HotChilli's avatar
    2 years ago

    Hi, I think I've created the calculated table but I'm unsure if it meets the 'desired result' screenshots posted.

    Here's the DAX:

    NewTable2 = 
    VAR CustomerKeyFilter = "CustomerName2"
    RETURN
        ADDCOLUMNS (
            FILTER ( 'Table1', 'Table1'[CustomerKey] = CustomerKeyFilter ),
            "WorkSpace", RELATED('Table2'[WorkSpace] ),
            "GroupName", RELATED(Table2[GroupName] ),
            "QuestionLabel", RELATED('Table2'[QuestionLabel]  )
        )

     Let me know if that moves you on a bit further.