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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
brtfrschnr
Frequent Visitor

Dynamically Summing Columns

Help me, Power BI Community. You're my only hope...

 

I need help with a query that create new columns that would sum Item totals by Area, Team, Group, and all Items and can be filtered by Item, Area, Team, Group, and Order Date.

 

GroupTeamAreaDateItemItem TotalArea TotalTeam TotalGroup TotalTotal
B199CS23111000766  9/29/20227360774600600420074099.6109248.84
B199CS231110132439/6/2022735802336003600420074099.6109248.84
B104CS131110169669/14/202273590811426.41426.41426.474099.6109248.84
B113CS131110055169/2/202273638544522.522612.522612.574099.6109248.84
B113CS131110055169/2/202273579061809022612.522612.574099.6109248.84
C104GL130400001689/9/202211397533143.2433143.2433143.2433143.2416109248.84
A178DW130200023959/12/20221707122006200620062006109248.84
B159CS131110147999/16/2022735931544600.744600.744600.774099.6109248.84
B109CS131110173869/29/2022736070912601260126074099.6109248.84

 

Filter = before 9/29/2022

 

GroupTeamAreaDateItemItem TotalArea TotalTeam TotalGroup TotalTotal
B199CS23111013243  9/6/2022735802336003600360072239.6107388.84
B104CS131110169669/14/202273590811426.41426.41426.472239.6107388.84
B113CS131110055169/2/202273638544522.522612.522612.572239.6107388.84
B113CS131110055169/2/202273579061809022612.522612.572239.6107388.84
C104GL130400001689/9/202211397533143.2433143.2433143.2433143.2416107388.84
A178DW130200023959/12/20221707122006200620062006107388.84
B159CS131110147999/16/2022735931544600.744600.744600.772239.6107388.84
2 REPLIES 2
BA_Pete
Super User
Super User

Hello Leia,

 

This will really need to be done in DAX, rather than Power Query. Try these measures:

 

_areaSum/Team/Group =
CALCULATE(
    SUM(yourTable[Item Total]),
    ALL(yourTable),
    VALUES(yourTable[Area]) // Just change this to Team/Group for the other totals
)

_totalSum =
CALCULATE(
    SUM(yourTable[Item Total]),
    ALL(yourTable)
)

 

 

Old Ben



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Thanks so much. I tried previously in DAX and Power BI behaved most petulantly. It's entirely possible I was providing faulty language, so I'll test and let you know the output.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.