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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Dynamic Running Total Month

Hello!

 

I would appreciate if you could help me or give some any help.

 

Sales Amount RT Year =

VAR FirstVisibleDate = MIN ( 'Date'[Date] )

VAR LastVisibleDate = MAX ( 'Date'[Date] )

VAR LastDateWithSales = CALCULATE ( MAX ( 'Sales'[Order Date] ), REMOVEFILTERS () )

VAR Result =

IF (

FirstVisibleDate <= LastDateWithSales,

CALCULATE (

[Sales Amount],

'Date'[Date] <= LastVisibleDate,

VALUES ('Date'[Calendar Year] )))

RETURN

Result

 

Robertois_0-1625144362988.png

But when i filter by month, the running total is not correct.

 

Robertois_1-1625144630521.png

Thank you!

1 ACCEPTED SOLUTION

@Anonymous 

pls try this

Measure = 
VAR _min=CALCULATE(min('date'[Date]),ALLSELECTED('date'))
VAR _date=max('date'[Date])
VAR _min2=date(year(_date),month(_min),1)
return CALCULATE(SUM('Table'[value]),FILTER(all('Table'),'Table'[date]>=date(year(_date),month(_min),1)&&'Table'[date]<=_date))

pls see the attachment below





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

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@Anonymous 

do you want to keep the RT value?

Measure = 
VAR _date=max('date'[Date])
return CALCULATE(SUM('Table'[value]),FILTER(all('Table'),'Table'[date]>=date(year(_date),1,1)&&'Table'[date]<=_date))

pls see the attachment below





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

Proud to be a Super User!




Anonymous
Not applicable

Hi, @ryan_mayu 

 

Thanks for the help! it gives me another ideas to solve other future situations, but didn't help me in that one. 

 

it has to be similar to that one ( i know its kinda tricky but i want to solve this scenario just for fun 😉

 

 

Robertois_0-1625210131373.png

 

@Anonymous 

pls try this

Measure = 
VAR _min=CALCULATE(min('date'[Date]),ALLSELECTED('date'))
VAR _date=max('date'[Date])
VAR _min2=date(year(_date),month(_min),1)
return CALCULATE(SUM('Table'[value]),FILTER(all('Table'),'Table'[date]>=date(year(_date),month(_min),1)&&'Table'[date]<=_date))

pls see the attachment below





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

Proud to be a Super User!




Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.