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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
PWRBI
Frequent Visitor

Countrows with Sumx not working

Hi guys,
I have the following data

 

StorageBoxpackageweight
AA1A10130
AA1A10220
AA2A201

40

AA2A202

30

 

Storage A has a capacity of 70. Now I would like to display in an additional table how many boxes in warehouse A still have free capacity. In the above example, this would be box A1 because 20 are still free, A2 is full with 70.

 

StorageFree boxes
A1

 

This is my Measure:

 

MEASURE =

VAR VAR1 = CALCULATE( SUMX( SUMMARIZE('STORAGE', STORAGE[STORAGE], STORAGE[BOX], "SCORE", sum(STORAGE[WEIGHT]), [SCORE] ))
VAR VAR2 = COUNTROWS(FILTER(DISTINCT(STORAGE[BOX]), VAR1< 70))

return VAR2

 

It works when I look at the box level, but when I want the total across all Storages, nothing shows up, so the total row doesn't match. What do I have to change?

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @PWRBI 
Please try

MEASUR =
SUMX (
    VALUES ( STORAGE[BOX] ),
    INT ( CALCULATE ( SUM ( TORAGE[WEIGHT] ) ) < 70 )
)

View solution in original post

3 REPLIES 3
tamerj1
Super User
Super User

Hi @PWRBI 
Please try

MEASUR =
SUMX (
    VALUES ( STORAGE[BOX] ),
    INT ( CALCULATE ( SUM ( TORAGE[WEIGHT] ) ) < 70 )
)
PWRBI
Frequent Visitor
PWRBI
Frequent Visitor

Thank you very much!!! 🙂 It works😍

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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