Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ryan_mayu
Super User
Super User

Running total

hi all,

 

I have a sample data.

ID date value
a 2021/1/1 100
a 2021/2/1 200
a 2021/4/1 300
a 2021/5/1 500
b 2021/3/1 600
b 2021/6/1 700
b 2021/7/1 800

 

and below is my expected output.

 

  Jan Feb Mar Apr May Jun Jul
a 100 300 300 600 1100 1100 1100
b     600 600 600 1300

2100

 

Thanks in advance





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




2 ACCEPTED SOLUTIONS
Jihwan_Kim
Super User
Super User

Picture1.png

 

Value cumulate : =
VAR _viewvalue =
CALCULATE ( MAX ( Data[date] ), REMOVEFILTERS () )
RETURN
IF (
HASONEVALUE ( 'Calendar'[Month Name] ),
IF (
MIN ( 'Calendar'[Date] ) <= _viewvalue,
CALCULATE (
SUM ( Data[value] ),
FILTER (
ALL ( 'Calendar'[Date] ),
'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
)
)
)
)

 

 

https://www.dropbox.com/s/fhitbnc2v1dnxrt/ryan.pbix?dl=0 

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

Hi,

Just change the cross filter direction to Single.  See image below:

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

7 REPLIES 7
Jihwan_Kim
Super User
Super User

Picture1.png

 

Value cumulate : =
VAR _viewvalue =
CALCULATE ( MAX ( Data[date] ), REMOVEFILTERS () )
RETURN
IF (
HASONEVALUE ( 'Calendar'[Month Name] ),
IF (
MIN ( 'Calendar'[Date] ) <= _viewvalue,
CALCULATE (
SUM ( Data[value] ),
FILTER (
ALL ( 'Calendar'[Date] ),
'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
)
)
)
)

 

 

https://www.dropbox.com/s/fhitbnc2v1dnxrt/ryan.pbix?dl=0 

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


@Jihwan_Kim 

thanks for your help. I can't open your pbix file since my pbi version is not the latest one. I tried to use your method based on your screenshot. However, I can't get accumulated count. could you pls advise?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur 

thanks for your help. I changed the sum to count and it works on your pbix file. However, i can't get the same result on mine. could you pls help on this?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi,

Just change the cross filter direction to Single.  See image below:

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur 

thanks for your help. This also solved the problem why I can't get the result which @Jihwan_Kim provided. just a littele change, the results are totally differrent. For me,still need to keep learning from experts like you.

@Jihwan_Kim 

thanks for your help. you soluition works as well.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




You are welcome.  Thank you for your kind words.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.