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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
mikeoshields
Helper I
Helper I

Count Number of Values in a Matrix

Dax question.  Below is a matrix of results and the rows/columns/values in the PowerBI project.  I need to count the number of values that are less than zero (see below).  

mikeoshields_0-1615922674328.png

mikeoshields_3-1615923297117.png

 

 

What I'm looking for is something like this:

mikeoshields_1-1615923023932.png

 

Any ideas would be appreciated.

3 REPLIES 3
amitchandak
Super User
Super User

@mikeoshields , Try measure like

 

countrows(summarize(Table[productCD], Table[Qtyonhand], Table[Date].Year, Table[Date].month))

 

or

 

 

countrows(summarize(Table[productCD], Table[Date].Year, Table[Date].month))

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 but that did not give me what I need.  I'd be happy to upload an excel file with the raw data as well as the PowerBI file but there doesn't seem to be a way to do that!

 

 

mikeoshields_1-1615987103182.png

 

I've included a link to the .pbix file as well as an excel spreadsheet of the raw data.  Again, any help is appreciated.

 

Count Number of Values in a Matrix 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.