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

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

Reply
gdavid
Regular Visitor

Measure - sum of multiple maxx

I need a measure to give me a sum of the last balance of all items in a date range.

I created this measure which will give me the latest balance on hand of each item

LatestBOH =
VAR CurrentValue = SELECTEDVALUE(PIX_InventoryCounts[ProductID]

RETURN
MAXX(
FILTER('PIX_InventoryCounts',PIX_InventoryCounts[ProductID] = CurrentValue ),
'PIX_InventoryCounts'[BalanceOnHand])

Example:
the date range is 3/1 thru 3/7

the data is

StoreDateProductIDbalanceOnHand

1

3/2/202112345
13/6/202112344
13/5/202198769
23/5/202112341
23/6/202198769
23/7/202198766

 

the measure LatestBOH returns

StoreProductIDLatestBOH
112344
198769
212341
298766

 

I need to be able to show the total LatestBOH with all item BOH combined by store.

the data should look like this

StoreTotal 
113      (9+4)
27     (6+1)

 

My attemp at a measure to do this just returned the MAXX of all the items.  ie. 9 and 6.  But I need a SUM of all the items MAXX value.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@gdavid , Try a measure like

 

Measure 10 = sumx(ADDCOLUMNS(SUMMARIZE('Table (3)', 'Table (3)'[ProductID], 'Table (3)'[Store],"_2", MAX('Table (3)'[Date])),"_4", maxx(FILTER('Table (3)', 'Table (3)'[Date] =[_2]),'Table (3)'[balanceOnHand])),[_4])
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@gdavid , Try a measure like

 

Measure 10 = sumx(ADDCOLUMNS(SUMMARIZE('Table (3)', 'Table (3)'[ProductID], 'Table (3)'[Store],"_2", MAX('Table (3)'[Date])),"_4", maxx(FILTER('Table (3)', 'Table (3)'[Date] =[_2]),'Table (3)'[balanceOnHand])),[_4])
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks. That is what I was looking for.  Summarize will help out a lot

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.