Forum Discussion

EnderWiggin's avatar
EnderWiggin
Helper I
5 years ago
Solved

Running total calculation without filter?

Hi All,

I created a running total calculation which counts from a start balance. The start balance contains the actual stock quantity, stock input output quantity before the actual month + actual month quantity.

Please, see this PBI file link for more details: RunningTotalWithCalendar 

My problem is that  the "0BeforeActual" column is not visible in visualization because of the applied filter, as you can see on the picture below. 

The first visualization shows the start balance calculation and the second one shows the running total

Running total measure

m_StockIORunningTotal = 
CALCULATE(
	[m_StockIODiffForRunningTotal],
	FILTER(
		ALLSELECTED('Calendar'[0BeforeActualYearMonth]),
		'Calendar'[0BeforeActualYearMonth] >= [m_ActualMonth] && 'Calendar'[0BeforeActualYearMonth] <= max('Calendar'[0BeforeActualYearMonth]))
	)

 Is there any way to create running total calculation without filtering the "0BeforeActual"  column? 

Thank you in advance!

  • aj1973's avatar
    aj1973
    5 years ago

    OK I think I found it, add "<" to this measure

     

    Looking good!

     

13 Replies

    • EnderWiggin's avatar
      EnderWiggin
      Helper I

      Hey aj1973 ,

       

      thank you for your fast reply! I tried it, but the running total calculation does not work on this way (as it can be seen on the picture you shared)

      m_StockIORunningTotal1 = 
      var StockIODiff = [m_StockIODiffForRunningTotal]
      var RT = CALCULATE(
      	StockIODiff,
      	FILTER(
      		ALLSELECTED('Calendar'[0BeforeActualYearMonth]),
      		'Calendar'[0BeforeActualYearMonth] >= [m_ActualMonth] && 'Calendar'[0BeforeActualYearMonth] <= max('Calendar'[0BeforeActualYearMonth]))
      	)
      return RT