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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.