cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
shaikhshafiii
Regular Visitor

Grand Total in Bar Chart

Dears,

 

I have below chart prepared calculting total spend busienes unit wise comparing two years and I need to see total of 2018 vs 2019 for all business unit at the end of chart. 

 

Bar Chart.PNG

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Suppose that you have a dataset like that 

a1sum2018
b2sum2018
c3sum2018
a2sum2019
b3sum2019
c4sum2019

 

the "sum" values in the table were added by me with creating column in power bi

 

 

Summarized the dataset like that 

sum6all2018
sum9all2019

 

"all" values in the table were added by me with creating column in power bi

 

and union this two table then i got this view. I thought it was fine for you



ss12.png


You can download pbix from there

View solution in original post

v-jiascu-msft
Microsoft
Microsoft

Hi @shaikhshafiii,

 

Another approach is as follows. You can download the demo from the attachment.

1. Create a new table.

Units =
UNION ( VALUES ( Table1[Unit] ), { "YearlyTotal" } )

2. Create a measure.

Measure =
VAR amount =
    SUM ( Table1[Amount] )
RETURN
    IF (
        ISBLANK ( amount ),
        CALCULATE ( SUM ( Table1[Amount] ), ALLEXCEPT ( Table1, Table1[Year] ) ),
        amount
    )

Grand-Total-in-Bar-Chart

 

Best Regards,

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

View solution in original post

5 REPLIES 5
pbi_user000
New Member

Hii,

 

how do i sorth the month name which are just "text ", as created

Anonymous
Not applicable

hi, @unnijoy  are you able to resolve the issue? I stuck in the same place.

v-jiascu-msft
Microsoft
Microsoft

Hi @shaikhshafiii,

 

Another approach is as follows. You can download the demo from the attachment.

1. Create a new table.

Units =
UNION ( VALUES ( Table1[Unit] ), { "YearlyTotal" } )

2. Create a measure.

Measure =
VAR amount =
    SUM ( Table1[Amount] )
RETURN
    IF (
        ISBLANK ( amount ),
        CALCULATE ( SUM ( Table1[Amount] ), ALLEXCEPT ( Table1, Table1[Year] ) ),
        amount
    )

Grand-Total-in-Bar-Chart

 

Best Regards,

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

I have a similar case. But if in Unit the total amount is 0 then it is shwoing the overll total for that purticular year.( For example lets take GV 2019. If the total Amount for GV 2019 is 0 then it should show as 0. 

As per the above formula it will show 29 ( 2019 Yearly total) for GV 2019. I need it to be 0. 

Please help.

Anonymous
Not applicable

Suppose that you have a dataset like that 

a1sum2018
b2sum2018
c3sum2018
a2sum2019
b3sum2019
c4sum2019

 

the "sum" values in the table were added by me with creating column in power bi

 

 

Summarized the dataset like that 

sum6all2018
sum9all2019

 

"all" values in the table were added by me with creating column in power bi

 

and union this two table then i got this view. I thought it was fine for you



ss12.png


You can download pbix from there

Helpful resources

Announcements
November 2022 Update

Check it Out!

Click here to read more about the November 2022 updates!

Microsoft 365 Conference â__ December 6-8, 2022

Microsoft 365 Conference - 06-08 December

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power BI Dev Camp Session 27

Ted's Dev Camp

This session walks through creating a new Azure AD B2C tenant and configuring it with user flows and custom policies.