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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
tdhlonghorn
Helper I
Helper I

Alter count calculation to show sum of individual results in matrix

Hello,

I'm trying to calculate % of product in stock, and I have SKU and Department listed in the Rows. I would like to see the count at the SKU level, but ensure that the Department result is the sum of the individual SKU counts (instead of calculating it using the same SKU-level formula). 

 

The following formula produces the expected result by SKU; the problem is that for the Department it applies the same calculation, meaning every SKU is counted because the total inventory by department is > 5.

I assume some application of IF(HASONEVALUE()) is required here but I'm not familiar enough with the DAX.

 

 

In Stock SKU Count = 
CALCULATE([SKU Count], 
    FILTER(SkuHistoricalInventory, [Current OH (var)] > 5)

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@tdhlonghorn , Try a measure like

 

Sumx(Filter(Summarize( Table, Table[Department], Table[SKU], "_measure", [Current OH (var)]), [Current OH (var)]>5), [SKU Count])

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

@tdhlonghorn , Try a measure like

 

Sumx(Filter(Summarize( Table, Table[Department], Table[SKU], "_measure", [Current OH (var)]), [Current OH (var)]>5), [SKU Count])

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

Amazing, that did the trick - thank you!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.

Top Solution Authors
Top Kudoed Authors