Power BI Exchange

Please login or click SIGN UP FOR FREE to create your PowerBIUG account to join this user group.
Expand all | Collapse all

How to show data by group and total on the same stacked graph

  • 1.  How to show data by group and total on the same stacked graph

    Posted May 14, 2019 02:32 PM
    Hi All!

    I'm trying to replicate the matrix table in a 100% stacked graph so that I have 'Corporate', 'Factory' and 'Total' all showing on the graph (see photo below). Does anyone have any suggestions for how to do this?

    Thanks!!! 

    ------------------------------
    Andrea Davidson
    ------------------------------


  • 2.  RE: How to show data by group and total on the same stacked graph

    Top Contributor
    Posted May 15, 2019 04:31 AM
    Hi @Andrea Davidson,

    You cannot get the total in a 100% bar chart, like you get it in a matrix table.

    What you could do is a workaround, by copying the same chart and removing the items from the Y-axis and aligning it with the original chart.
    All filters will work on both the charts and even the cross filtering between charts should work as well.

    I know its not the ideal solution that you are looking for, but as I said before, it is a workaround.

    Thank you,

    Vishesh Jain​

    ------------------------------
    Vishesh Jain
    Owner
    VR Construction
    ------------------------------



  • 3.  RE: How to show data by group and total on the same stacked graph

    Gold Contributor
    Posted May 15, 2019 06:14 AM
    Hi Andrea,

    I am not sure I am able to understand your question correctly. But I am able to reproduce what you are looking for (I guess).


    I have also uploaded both the file here.

    Hope this will help you.

    Regards,

    ------------------------------
    Tuhin Tapadar
    Data Analyst
    Dublin
    894164048
    ------------------------------

    Attachment(s)

    xlsx
    bb.xlsx   8K 1 version
    pbix
    nn1.pbix   29K 1 version


  • 4.  RE: How to show data by group and total on the same stacked graph

    Bronze Contributor
    Posted May 15, 2019 03:13 PM
      |   view attached
    I think this is what you are looking for.  I referenced the original data without the group in a query named "Totals", renamed the group as "Total", then performed a union of the original and the total with the new group. Attached is the file with the DAX.



    ------------------------------
    Nathan Nelson
    Business Intelligence Developer
    United States
    ------------------------------

    Attachment(s)

    pbix
    nn1.pbix   37K 1 version


  • 5.  RE: How to show data by group and total on the same stacked graph

    Top Contributor
    Posted May 15, 2019 11:17 PM
      |   view attached
    Hi,

    You can alternatively choose Line & Stack column chart and put the values on line series as well. Please see attached .pbix;

    Regards,

    ------------------------------
    Hasham Bin Niaz
    Director Data & Analytics
    Karachi, Pakistan
    ------------------------------

    Attachment(s)

    pbix
    nn1.pbix   35K 1 version