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 September 15. Request your voucher.

Reply
cvaldez96
New Member

Help with showing counts without summing or using MAX?

Honestly, I have no idea if this is possible but would like to see if anyone has any solutions. I have a matrix and a bar graph showing counts of vehicles by month and year and I have them filtered by Branch using a slicer and a month slicer. For example, I have three branches: Portland, Nashville, Seattle. When I select all three branches, the Max calculation just shows the highest branch total which is Portland instead of adding all three branches to give me the total number of vehicles. Another issue with using MAX is it only works if the number of vehicles increases by every month but sometimes a vehicle is out of commission but it'll still just take the max number. So I tried to remedy this using SUM but when collapsing the Matrix, it just adds all the vehicles together making it seem like we have multiple times the vehicles we actually do. And I'm not able to use SUM for my bar graph. Does anyone have any solutions that could solve these issues?

cvaldez96_1-1725036524441.png

cvaldez96_2-1725036551489.png

My data source

cvaldez96_3-1725036760989.png

 

 

1 ACCEPTED SOLUTION
cvaldez96
New Member

Figured it out!

Vehicle Count Branch =
LASTNONBLANKVALUE('AF Miles Vehicles'[Month], SUM('AF Miles Vehicles'[Count of Vehicle]))
 
I used this calculation using the month number to sort by and then the sum as my second parameter. I used this page for help : https://exceleratorbi.com.au/lastnonblank-explained/

 

View solution in original post

2 REPLIES 2
cvaldez96
New Member

Just wanted to give some more information 

 

cvaldez96_0-1725040265699.png

April had less vehicles than March but when collapsing the matrix, it used March's value since it was the max value. But after using my formula above:

cvaldez96_1-1725040327385.png

It is now taking April's vehicle count as the last non blank value.

 

And when I select all my branches, it adds up each branch's last value calculating the total!

 

 

 

cvaldez96
New Member

Figured it out!

Vehicle Count Branch =
LASTNONBLANKVALUE('AF Miles Vehicles'[Month], SUM('AF Miles Vehicles'[Count of Vehicle]))
 
I used this calculation using the month number to sort by and then the sum as my second parameter. I used this page for help : https://exceleratorbi.com.au/lastnonblank-explained/

 

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.

Top Solution Authors
Top Kudoed Authors