Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
v-jacogs
New Member

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

The sample table:

GroupDateSales
ADec100
AJan100
AFeb100
AMar100
BJan100
BFeb100
BMar100

The slicer applied:

 skicer.PNG

I want the table to look like:

GroupDateSalesGroupTotal
AJan100200
AFeb100200
BJan100200
BFeb100200

the Group total representing the subtotal by group.

 

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

GroupDateSalesA
AJan100400
AFeb100400
BJan100400
BFeb100400

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

 

GroupDateSalesB
AJan100400
AFeb100400
BJan100300
BFeb100300

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

 

How can I do both?

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

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.

 

Capture1.PNG

 

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

 

Capture.PNG

 

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.
Anonymous
Not applicable

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

Could you take a look and find why, please? 

 

Capture.PNG

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

Check out the May 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

May 2025 Monthly Update

Fabric Community Update - May 2025

Find out what's new and trending in the Fabric community.