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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors