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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
LSatPD
Regular Visitor

Using cummulated sum and loops in Power BI

Hi,

 

I'm new to DAX and I need a measure (or a calculated column) that would accumulate a sum within a loop of days.

My problem is quite simple: I have 5 minuts increments readings of rainfall. 
I want to plot the daily cumulative rainfall. 

 

As I said, I am very new to DAX and I can't figure it out.

What I have here is an hourly filter that shows me the fist day correctly, but after that, it carries the hourly values to the next days. (The green line indicates if there has been rain or not)

 

bipost.PNG

1 REPLY 1
Anonymous
Not applicable

@LSatPD  - It appears that ALLSELECTED function is causing all of the days to be considered. I think that instead of ALLSELECTED(LTU_Rain_Date), you could use ALL(LTU_Rain_Date[Time_Hour]). So instead of considering all days, you consider all hours and then limit hours to only the current hour or prior.

 

Also, it is preferable to store MAX(LTU_Rain_Date[Time_Hour]) in a variable and then use it.

var current_hour = MAX(LTU_Rain_Date[Time_Hour])
return CALCULATE(........LTU_Rain_Date[Time_Hour] < current_hour.....)
I hope this helps. If it does, please Mark as a solution.
I also appreciate Kudos.
Nathan Peterson

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors