Forum Discussion

sseverson12's avatar
sseverson12
Frequent Visitor
9 years ago
Solved

Stacked Column chart with values from multiple columns

Hello,   We have an interesting problem that we're trying to solve and I am hoping to get some help. I am trying to create a stacked bar/column chart that combines data from multiple calculated col...
  • v-yulgu-msft's avatar
    9 years ago

    Hi sseverson12

     

    In this scenario, I suppose the table looks like below after adding four calculated columns using the formula you provided:

     

    Based on this table, then new four tables for PE, FD, EX,CM. As an example, below is the DAX for the PE table:

     

    Table1 = ADDCOLUMNS(SELECTCOLUMNS(MergedTable,"Status",MergedTable[PEStatus]),"Category","PE")

     

    After all tables being prepared, union them:

     

    Table5 = ADDCOLUMNS(UNION(Table1,Table2,Table3,Table4),"Value",1)

     

    Then, create a stacked column chart with "Category" as the Axis, "Status" as the legend and "Value" as value.

     

    Best regards,
    Yuliana Gu