Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

How to display total a Stacked Column Chart

I have  database table like master .  In the database i have two column   Reduction buckets   and value . table value looks like below 

 

 

 

 Reduction buckets                                     Value

 Overstock consumption                              2.80

 New Materials                                             (2.18)

 Scrap                                                           0.40

 supply Improvement                                   0.76

Sell back To OEM                                          0.15

 

 

i making this table in to graph 

 

 

but how i will add total varaition of all total grpah like below images 

 

 

 

  • Hi, Anonymous 

    According to your description, I can roughly understand your requirement, I think you can try to create a calculated table like this and place it into the waterfall chart to achieve your requirement

    New table =
    
    var _total=ROW("Reduction buckets","Total","Value",SUMX(ALL('Table'),[Value]))
    
    return
    
    UNION('Table',_total)

    Then you can get thet able like this:

     

    Then you can get the chart like this:

     

    You can download my test pbix file below

    Thank you very much!

     

    Best Regards,

    Community Support Team _Robert Qin

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

6 Replies

  • Hi Anonymous 

     

    Create a new table with this code:

    Table 2 = union('Table',row("Reduction buckets","total varaition","Value",CALCULATE(sum('Table'[Value]),all('Table'))))

     

    then use that to create a chart:

     

     

     

     

    If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
    Appreciate your Kudos!!


    LinkedIn: 
    www.linkedin.com/in/vahid-dm/

     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    VahidDM  let me check  .thank you so much 

    • v-robertq-msft's avatar
      v-robertq-msft
      Icon for Community Support rankCommunity Support

      Hi, 

      Have you followed the DAX formula posted by VahidDM to find the solution to your problem?

      If so, would you like to mark his reply as a solution so that others can learn from it too?

       

      Thanks in advance!

      How to Get Your Question Answered Quickly 

       

      Best Regards,

      Community Support Team _Robert Qin

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

  • Anonymous's avatar
    Anonymous
    Not applicable

    VahidDM   i am getting below warning trying to apply above measure 

     

     

    • VahidDM's avatar
      VahidDM
      Icon for Super User rankSuper User

      Hi Anonymous 

       

      Your tables in UNION must have same columns, and it seams your Master Data Base has more that 2 columns.

      Please try this measure:

      Table 2 =
      UNION(
          SUMMARIZE( Table, 'Table'[Reduction buckets], 'Table'[Value] ),
          ROW(
              "Reduction buckets", "total varaition",
              "Value", CALCULATE( SUM( 'Table'[Value] ), ALL( 'Table' ) )
          )
      )

       

      If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
      Appreciate your Kudos!!
      LinkedIn: 
      www.linkedin.com/in/vahid-dm/

       

       

  • v-robertq-msft's avatar
    v-robertq-msft
    Icon for Community Support rankCommunity Support

    Hi, Anonymous 

    According to your description, I can roughly understand your requirement, I think you can try to create a calculated table like this and place it into the waterfall chart to achieve your requirement

    New table =
    
    var _total=ROW("Reduction buckets","Total","Value",SUMX(ALL('Table'),[Value]))
    
    return
    
    UNION('Table',_total)

    Then you can get thet able like this:

     

    Then you can get the chart like this:

     

    You can download my test pbix file below

    Thank you very much!

     

    Best Regards,

    Community Support Team _Robert Qin

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