Forum Discussion

Nathan_powerbi's avatar
Nathan_powerbi
Frequent Visitor
9 years ago
Solved

Create new table based on calculations between columns from two different columns

Dear Power BI users,   We are struggling to do a calculation using the following tables:   Table 1 Projectnumber | Type | ID 1                           A        1 1                           ...
  • Anonymous's avatar
    Anonymous
    9 years ago

    Hi,

     

    If you first create a new column in Table2  named Type= Related(Table1[Type]).

     

    Then you can create a new calculated table with the following dax code:

    NewTable = SUMMARIZE (
        Table2;
        Table2[ProjNum];
        "Value_Score_Multiplied"CALCULATE ( VALUES ( Table2[Value] )FILTER ( Table2; Table2[Type] = "A" ) )
            * (
                CALCULATE ( VALUES ( Table2[Value] )FILTER ( 'Table2'; Table2[Type] = "B" ) )
                    + CALCULATE ( VALUES ( 'Table2'[Value] )FILTER ( Table2; Table2[Type] = "C" ) )
            )
    )

     

    Br,

    Magnus