cancel
Showing results for
Did you mean:
Frequent 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.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Member

## Re: Grand Total in Bar Chart

Suppose that you have a dataset like that

 a 1 sum 2018 b 2 sum 2018 c 3 sum 2018 a 2 sum 2019 b 3 sum 2019 c 4 sum 2019

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

Summarized the dataset like that

 sum 6 all 2018 sum 9 all 2019

"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

Community Support Team

## Re: Grand Total in Bar Chart

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
)
```

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.
2 REPLIES 2
Member

## Re: Grand Total in Bar Chart

Suppose that you have a dataset like that

 a 1 sum 2018 b 2 sum 2018 c 3 sum 2018 a 2 sum 2019 b 3 sum 2019 c 4 sum 2019

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

Summarized the dataset like that

 sum 6 all 2018 sum 9 all 2019

"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

Community Support Team

## Re: Grand Total in Bar Chart

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
)
```

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.