cancel
Showing results for
Search instead for
Did you mean:
Occasional Visitor

## Help is there a function to have subtotals in a column?

The sample table:

 Group Date Sales A Dec 100 A Jan 100 A Feb 100 A Mar 100 B Jan 100 B Feb 100 B Mar 100

The slicer applied:

I want the table to look like:

 Group Date Sales GroupTotal A Jan 100 200 A Feb 100 200 B Jan 100 200 B Feb 100 200

the Group total representing the subtotal by group.

A = CALCULATE( SUM('Table'[Sales]),ALLSELECTED())

 Group Date Sales A A Jan 100 400 A Feb 100 400 B Jan 100 400 B Feb 100 400

this gets the total for everything that is not filterred out not a subtotal fro each group though.

B=CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Date]))

 Group Date Sales B A Jan 100 400 A Feb 100 400 B Jan 100 300 B Feb 100 300

this gets a subtotal for each group. This subtotal includes data that was filtered out.

How can I do both?

2 REPLIES 2
Community Support Team

## Re: Help is there a function to have subtotals in a column?

Hi @v-jacogs,

You could try to create the measure below to get your excepted output.

```Group_total =
CALCULATE ( SUM ( test[Sales] ), ALLSELECTED ( test[Group] ) )```

Then you will get the result.

In addition, you could create the Matrix visual and get the Subtotal simply as below.

Hope it can help you!

Best Regards,

Cherry

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

## Re: Help is there a function to have subtotals in a column?

I have the same problem, and your solution seems not working for me...

Could you take a look and find why, please?

## Helpful resources

Announcements

#### Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

#### Community News & Announcements

Get your latest community news and announcements.

#### Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

#### Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Top Kudoed Authors
Users Online
Currently online: 45 members 1,048 guests
Recent signins:
Please welcome our newest community members: