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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
RafaelAri
Helper III
Helper III

Count rows of filtered table

The attached Excel file contain original data table ("Table") and the required results table.

This Table contains items qty in 3 warehouses, and qty rented at customers sites.

First, I need to get SUM of WH-qty and Rente- qty, for each item, and then I need to filter items that have "0" for WH-qty AND Rented- qty

I need a DAX measure to get the rows count in the results table.

WHItem No.Qty. by WHRented Qty. Item No.Qty. by WHRented Qty.
WH-16100020480 890603000
WH-2610002000 8900080-8000
WH-36100020240 8900090-8000
WH-16100030540    
WH-16100040460    
WH-2610004000    
WH-3610004080    
WH-3890022000    
WH-2890022014034    
WH-18900230600    
WH-28900230840    
WH-18900400250    
WH-289004001747    
WH-38900400150    
WH-18900410320    
WH-289004102173    
WH-38900410220    
WH-1890042000    
WH-3890042020    
WH-289004208121    
WH-1890043000    
WH-38900430150    
WH-289004301044    
WH-28900430044    
WH-1890401130    
WH-38904011350    
WH-28904011350    
WH-3890603000    
WH-1890610000    
WH-3890610000    
WH-28906100038    
WH-18900070-8000    
WH-18900080-8000    
WH-18900090-8000    
1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@RafaelAri 

should 8900070-80 also be included in the result table?

if so, maybe you can try this

Measure = 
VAR tbl=SUMMARIZE('Table','Table'[Item No.],"WH",sum('Table'[Qty. by WH]),"rent",sum('Table'[Rented Qty.]))
return COUNTROWS(FILTER(tbl,[WH]=0 && [rent]=0))

11.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@RafaelAri 

should 8900070-80 also be included in the result table?

if so, maybe you can try this

Measure = 
VAR tbl=SUMMARIZE('Table','Table'[Item No.],"WH",sum('Table'[Qty. by WH]),"rent",sum('Table'[Rented Qty.]))
return COUNTROWS(FILTER(tbl,[WH]=0 && [rent]=0))

11.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks ryan_mayu 👍

you are right, 8900070-80 should also be in the results counting

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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