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
sprakash1192
Helper II
Helper II

Filtering on running total values

I have a running total measure that calculates roll forward of my inventory -

RollForward = CALCULATE(
[Inv_Qty_Cont_Agg],
FILTER(
ALLSELECTED('Calendar'[CALDATE_0]),
Calendar'[CALDATE_0]<= MAX(Calendar'[CALDATE_0])
))
 
I take this measure and put it on a matrix visual with dates across the top. I then want to be able to filter my visual to only where my RollForward value is less than zero. So, I want to see dates where the roll forward number goes below zero. When I put a filter on the visual to RollForward less than 0, the visual only filter where the total at the end is less than zero. If there were negaitves on some days, but the total at the end is positive, the visual wont display those instances when the less than zero filter is applied.
 
How can I resolve this?
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @sprakash1192 ,

 

I have built a data sample to test:

Date-value data sample.PNG

You could use the following formula to filter RollForward <0

RollForward = var _v= CALCULATE([Inv_Qty_Cont_Agg],FILTER(ALLSELECTED('Calendar'[CALDATE_0]),'Calendar'[CALDATE_0]<=MAX('Calendar'[CALDATE_0])))

return IF(_v>0,BLANK(),_v)
Measure = IF(HASONEVALUE('Calendar'[CALDATE_0]),[RollForward],SUMX('Calendar',[RollForward]))

filter measure.jpg

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @sprakash1192 ,

 

I have built a data sample to test:

Date-value data sample.PNG

You could use the following formula to filter RollForward <0

RollForward = var _v= CALCULATE([Inv_Qty_Cont_Agg],FILTER(ALLSELECTED('Calendar'[CALDATE_0]),'Calendar'[CALDATE_0]<=MAX('Calendar'[CALDATE_0])))

return IF(_v>0,BLANK(),_v)
Measure = IF(HASONEVALUE('Calendar'[CALDATE_0]),[RollForward],SUMX('Calendar',[RollForward]))

filter measure.jpg

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.