Forum Discussion
Running total calculation without filter?
- 5 years ago
OK I think I found it, add "<" to this measure
Looking good!
Hey,
If i use the logic you used in your measure i get this
Is it correct!
the difference resides in your measure when you use [m_ActualMonth]
where is that measure coming from? can't find it anywhere!
it is like the measure is coming from a different table, which is not correct inside the FILTER.
Hey aj1973,
firstly, I really appreciate your help and thank you for your efforts for solving this issue!
Sorry, If I was not clear enough, so I try to summarize the details in the following:
1. as I wrote in the first post, the running total calculation base is a start balance which contains:
the actual stock quantity, stock input output quantity before the actual month + actual month quantity. This start balance is the value of the actual month (actually it is 202107), in case of other months simply the StockInputOutput[IODiff] value is calculated.
2. The m_actualMonth measure is for providing the actual month value and it is int the LoadedAt table which was hidden in report view, now I set it visible.
"it is like the measure is coming from a different table, which is not correct inside the FILTER."
If I understood correctly, if the measure in the Calendar table then it is ok, so I created the
m_CalendarActualMonth = calculate(min('Calendar'[0BeforeActualYearMonth]),'Calendar'[0BeforeActualYearMonth] <> "0BeforeActual")
measure in Calandar table and used it instead of m_actualMonth in the other measures.
Unfortunately, it did not solve the problem, the running total is ok, but the "0BeforeActual" column is hidden in visual. You can check it in this RunningTotalDemoWithCalendar1_aj1973_2 file.
3. Running total
This running total calculation shows the "0BeforeActual" column but it is nok, becasuse does not calculate with the start balance:
I hope, it helps to understand my aspect. Thank you!
- aj19735 years agoCommunity Champion
Hey,
I have been trying hard to understand the logic of your measure but in vain, however I can say that this 'Calendar'[0BeforeActualYearMonth] is of type Text and numbers therefore not possible to compare it to a scalar of type number, I am refering to
MAX('Calendar'[0BeforeActualYearMonth]), same thing for the other measure.I Replaced && by | | to see the difference and --->Conclusion : I am not sure the filter is working properly and I wonder if the result is thus correct!
- EnderWiggin5 years agoHelper I
Hey aj1973,
Ok, I changed the type of the 0BeforeActualYearMonth from text to number and modified the related measures according to the changes. Here is the result: RunningTotalDemoWithCalendar1_aj1973_3
I don't see any significant changes in the result. If the running total with start balance works then the 0 column (this was 0BeforeActual value in the previous versions) is not visible. If the 0 column is visible then the running total does not work.
So, back to my original question:
"Is there any way to create running total calculation without filtering the "0BeforeActual" column?"
Thank you!
- aj19735 years agoCommunity Champion
OK I think I found it, add "<" to this measure
Looking good!