Forum Discussion

MiaZhao's avatar
MiaZhao
Helper I
8 years ago
Solved

Stacked chart with multiple values

Hi Everyone,

 

How can I draw a stacked chart with multiple values?

 

For instance, show budget as one column, and actual by each salse as one column.

 

  • Hi MiaZhao

    Formula below will help

    Table =
    VAR Table1 =
        SUMMARIZE (
            Budget,
            "value", CALCULATE ( MAX ( Budget[budget] ), FILTER ( Budget, [month] = 5 ) ),
            "Legend", "Budget",
            "category", "Budget"
        )
    VAR Table2 =
        SUMMARIZE ( Actual, Actual[amount], [sales], "category", "may closed sales" )
    RETURN
        UNION ( Table1, Table2 )

     

    Here is my Pbix.

     

    Best Regards

    Maggie

3 Replies

  • More details.

    Budget

    monthyearbudget
    12018100
    22018100
    32018100
    42018100
    5201875

    Actual

    datesalesamount
    5/1/2018A5
    5/2/2018B30
    5/3/2018C4
    5/4/2018A5
    5/5/2018B11
    5/6/2018C9
    • v-juanli-msft's avatar
      v-juanli-msft
      Community Support

      Hi MiaZhao

      Formula below will help

      Table =
      VAR Table1 =
          SUMMARIZE (
              Budget,
              "value", CALCULATE ( MAX ( Budget[budget] ), FILTER ( Budget, [month] = 5 ) ),
              "Legend", "Budget",
              "category", "Budget"
          )
      VAR Table2 =
          SUMMARIZE ( Actual, Actual[amount], [sales], "category", "may closed sales" )
      RETURN
          UNION ( Table1, Table2 )

       

      Here is my Pbix.

       

      Best Regards

      Maggie