Forum Discussion
Filtering rolling total based on value in another column
- 4 years ago
Hi SamOvermars ,
Maybe you should filter the data in the measure
Measure = CALCULATE( COUNTROWS('table') ,FILTER( ALL( 'table'[Date Produced]), 'table'[Date Produced] <= MAX('table'[Date Produced]) && 'table'[Produced Truck2 Requested]<>0))
Hi SamOvermars,
If you replace
ALLSELECTED( 'table'[Date Produced])
with
ALL( 'table'[Date Produced])
does that do the trick, now you might have to add a min date to your filter like
'table'[Date Produced] >= MIN('table'[Date Produced]) && 'table'[Date Produced] <= MAX('table'[Date Produced])Hi richbenmintz , Thank you for your response, I tried with that but it started showing me the items count every day in the line chart. which is not what I desired. I needed the rolling total that can be filtered. Seems like the issue I have is with the COUNTX part instead of the date. Just not sure how to tackle it.
- richbenmintz4 years agoResident Rockstar
Hi SamOvermars ,
Using your sample data and assuming you are looking to count the rows cummulatively, the following Measure should work
Measure = CALCULATE( COUNTROWS('table') ,FILTER( ALL( 'table'[Date Produced]), 'table'[Date Produced] <= MAX('table'[Date Produced])))produces the following line chart
If you need a different outcome please include a more representative set of data and a screen cap of the desired result.
- SamOvermars4 years agoHelper I
Thank you richbenmintz Almost!It worked but its not letting me filter the visual.
Is there any reason why the line chart looks like this after adding a filter to the visual where truck 2 is not 0
- richbenmintz4 years agoResident Rockstar
Hi SamOvermars ,
Maybe you should filter the data in the measure
Measure = CALCULATE( COUNTROWS('table') ,FILTER( ALL( 'table'[Date Produced]), 'table'[Date Produced] <= MAX('table'[Date Produced]) && 'table'[Produced Truck2 Requested]<>0))