Forum Discussion

POSPOS's avatar
POSPOS
Post Partisan
2 years ago
Solved

Create a summary table using DAX

Hi, I have a requirement to create a summary table based on three other tables. Please find sample data below Table1: Table2: Table3: Expected Outut: Create a summary table w...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi POSPOS ,

     

    The calculated table is static, here's the formula:

     

    Table 2 = var _table={"Stage1","Stage2","Stage3"}
    return ADDCOLUMNS(_table,"Count",SWITCH([Value],"Stage1",[Stage1_Count],"Stage2",[Stage2_Count],"Stage3",[Stage3_Count]))

     

     

    If you want the dynamic counting result, you should create a table with three stages. And put a measure into the table visual. Because measures are dynamic.

     

    Here're the steps.

    1.Table with three stages. You can also create it by entering data.

    2.Create a measure.

     

    Measure = SWITCH(MAX('Table 3'[Value]),"Stage1",[Stage1_Count],"Stage2",[Stage2_Count],"Stage3",[Stage3_Count])

     

    3.Here's the result.

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.