Forum Discussion
Running Total per Month from a Measure
- 7 years ago
Hi AlbLS
I've simplified this for you, hope its what you need.# Entries = COUNTROWS( Entries )
# Departures = COUNTROWS( Departures )
# Difference = [# Entries] - [# Departures]
# Difference Running Total = IF( NOT ISEMPTY( Departures ) || NOT ISEMPTY( Entries ), CALCULATE( [# Difference], FILTER( ALL( 'Date' ), 'Date'[Date] <= MAX( 'Date'[Date] ) ) ) )Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
Hi AlbLS
I've simplified this for you, hope its what you need.
# Entries = COUNTROWS( Entries )
# Departures = COUNTROWS( Departures )
# Difference = [# Entries] - [# Departures]
# Difference Running Total =
IF(
NOT ISEMPTY( Departures ) || NOT ISEMPTY( Entries ),
CALCULATE(
[# Difference],
FILTER(
ALL( 'Date' ),
'Date'[Date] <= MAX( 'Date'[Date] )
)
)
)Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
- AlbLS7 years agoFrequent Visitor
Hi Mariusz,
Thank you very much for your answer.Unfortunately this does not solve my problem, as you can see in the following picture:
What I need is a graph like this:
when I'm going to filter for the year 2017, i will get this:
and filter for the year 2018, this:
I hope we can find the solution, for the moment I can not do it.
Thank you very much again.
Alberto
- Mariusz7 years agoCommunity Champion
Hi AlbLS
Please see the file in the link.https://drive.google.com/file/d/1ZDGVjlu4nNnweYCk6H9NUkWgX5Iscy2A/view?usp=sharing
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.- AlbLS7 years agoFrequent Visitor
Thank you very much Mariuzs.
Your solution works perfectly, I really thank you. In addition, you have simplified the task because now I do not need different formulas for years and months, with your solution it works for both cases. It's perfect!
There is only one thing that I changed, I deleted from your formula the following part:
IF (
NOT ISEMPTY (Departures) || NOT ISEMPTY (Entries)
)
Because it caused empty columns when there were no entries and no departures for a year or for a month. As we see here:But i delete the IF statement, it works very well.
Thanks again.
Alberto