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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
J_L
Frequent Visitor

Help with Subtotal in the standard table (cannot use Matrix)

Hi team,

 

Hope you're all doing well all things considered. 

 

I need help with creating (adding) a dynamic subtotal row in the standard table. I cannot use a Matrix because it will aggregate the rows and I require visibility of all associated line items that make up that subtotal.

 

I've tried this solution provided by @BILASolution but it didn't solve my problem (or I may not have understood the measure/DAX completely).

 

https://community.powerbi.com/t5/Desktop/Subtotals-in-a-table-that-has-multiple-attributes-in-each-d...

 

In my sample data below, I've provided a current state and a desired state. The Subtotal will need to be dynamic as there will be slicers (such as Date and Item, etc..)

 

Current State

 

DateDayItemSoldUnsold
1st janFriShirt2312
1st janFriPants562
1st janFriShorts211
2nd janSatShirt122
2nd janSatShorts2112
3rd janSunPants124
4th janMonShirt1113
4th janMonPants3254
4th janMonShorts5432
Total  242132

 

Desired state

 

DateDayItemSoldUnsold
1st janFriShirt2312
1st janFriPants562
1st janFriShorts211
   10015
2nd janSatShirt122
2nd janSatShorts2112
   3314
3rd janSunPants124
   124
4th janMonShirt1113
4th janMonPants3254
4th janMonShorts5432
   9799
Total  242132

 

Any help will be greatly appreciated!!!

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@J_L you can easily achieve this with matrix visual, add date, day, an item on rows and turn off step layout on format page, add column that contains sold/unsold on columns or create two measures that does the sum for sold and unsold.

 

You can turn off the row-level total for everything except date and everything should work as expected and no fancy work required.

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

 The fact that in order to do the simplest thing possible - make a table with subtotals - without having to either use a control you don't want, or a hack, just reinforces that PowerBI is the sh*ttiest tool imaginable.

 

parry2k
Super User
Super User

@J_L glad it worked out, indeed, never hesitate to reach out.

 

Good luck!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@J_L you should add a measure something like this for these text columns:

 

Text Measure = 
IF ( HASONEVALUE ( Table[ColumnOnTheRow] ), MAX ( Table[YourTextColumn] ) )

 

and use this measure in the visual, so basically on the total rows, it will show as blank(), or other trick is, in format pane, under filter formatting, change the foreground color of these text column same as background color and apply to the totals only, so total will be hidden with same foreground and background color.

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

J_L
Frequent Visitor

@parry2k mate, you're brilliant!!! Thanks so much, so far so good, I'll reach out if I need further help... 

parry2k
Super User
Super User

@J_L why you have text columns in the values section, put those on the rows and drill down with stepped layout off, but if you want text column on the values then we can control that will few tricks.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

J_L
Frequent Visitor

Hi @parry2k hope you had a good weekend and thanks for getting back to me, much appreciated! I've moved as many text items to rows as possible and am almost there however I do need a few text columns on the values (without being included in the subtotal) - what are these tricks?

parry2k
Super User
Super User

@J_L you can easily achieve this with matrix visual, add date, day, an item on rows and turn off step layout on format page, add column that contains sold/unsold on columns or create two measures that does the sum for sold and unsold.

 

You can turn off the row-level total for everything except date and everything should work as expected and no fancy work required.

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

J_L
Frequent Visitor

Thanks @parry2k for the quick response. You might have solved this for me!! I'm trying now with my actual data but one thing I've not been able to do so far is remove the subtotals for some of the columns that I don't want to be "subtotaled" the subtotal applies to all the columns, even text columns, which come as First....

 

Any further help will be greatly appreciated.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.