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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
moseshewetson
Frequent Visitor

Running total limit

Hello, I have a live running total for the month from our accounting system which i am having trouble with.

 

Here is the current formula:

 

Running total = 
IF(
	MIN('Date'[Date]) <= CALCULATE(MAX(DR_INVLINES[TRANSDATE]), ALL(DR_INVLINES)),
CALCULATE(
	SUM('DR_INVLINES'[Total (NZD)]),
	FILTER(
		ALLSELECTED('Date'[Date]),
		ISONORAFTER('Date'[Date], MAX('Date'[Date]), DESC) && 
			MONTH('Date'[Date]) = MONTH(TODAY()) && 
			YEAR('Date'[Date]) = YEAR(TODAY())
			
	)
)
)

And the result:

 

My problem is that invoices are often done in advance so that (as you can see in the picture) there is values past today's date. This is due to MAX('date'date). Can someone help to modify the formula so it only displays values less than or equal to today's date?

Everything I have tried results in a flat running total line or the line continuing on to those dates but just showing no increase.

 

Thanks!!!!

1 ACCEPTED SOLUTION

Hi @moseshewetson,

From your file, you have created the cline chart, which displays the data and running total before today. Based on your description :"Can someone help to modify the formula so it only displays values less than or equal to today's date?", I think you have got your target. While for "I need a way to filter out all transactions that are ahead of today's date so the running total line does not show dates ahead of time.", you does not show datea before today? It's confusing.

You also can create your measure using the following formula.

Running totalTest1 = 
IF(FIRSTNONBLANK('Date'[Date],1)<TODAY(),CALCULATE(
 SUM(Sales[Amount]),
 FILTER(
 
  ALL('Date'), 'Date'[Date]<=MAX('Date'[Date])
)))


Please see the following formula, it only shows data and running total before today.

1.PNG

Thanks,
Angelia

View solution in original post

7 REPLIES 7
Greg_Deckler
Community Champion
Community Champion

		ISONORAFTER('Date'[Date], MAX('Date'[Date]), DESC) && 
			MONTH('Date'[Date]) = MONTH(TODAY()) && 
			YEAR('Date'[Date]) = YEAR(TODAY()) &&
DAY('Date'[Date]) <= DAY(TODAY())

 

?

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...


@smoupre wrote:
		ISONORAFTER('Date'[Date], MAX('Date'[Date]), DESC) && 
			MONTH('Date'[Date]) = MONTH(TODAY()) && 
			YEAR('Date'[Date]) = YEAR(TODAY()) &&
DAY('Date'[Date]) <= DAY(TODAY())

 

?

 


Nope Tried that...

 

Untitled picture.png

It still includes the dates but just shows no values...

Hi @moseshewetson,

In the screenshot, what's the means of the dotted line, hows the date? And could you please share more details for further analysis?

Thanks,
Angelia

Hello @v-huizhn-msft

 

The dotted line is just a trend line.

 

'Date' is a date table linked to a transaction table ('DR_INVLINES') that contains all of the sales transactions for the company.

 

I need a way to filter out all transactions that are ahead of today's date so the running total line does not show dates ahead of time.

 

Thanks.

Hi @moseshewetson,

Got it. Do you mind share some sample data, or .pbix file for further analysis. So we can post solution which is close to your requirement.

Thanks,
Angelia

Hi @moseshewetson,

From your file, you have created the cline chart, which displays the data and running total before today. Based on your description :"Can someone help to modify the formula so it only displays values less than or equal to today's date?", I think you have got your target. While for "I need a way to filter out all transactions that are ahead of today's date so the running total line does not show dates ahead of time.", you does not show datea before today? It's confusing.

You also can create your measure using the following formula.

Running totalTest1 = 
IF(FIRSTNONBLANK('Date'[Date],1)<TODAY(),CALCULATE(
 SUM(Sales[Amount]),
 FILTER(
 
  ALL('Date'), 'Date'[Date]<=MAX('Date'[Date])
)))


Please see the following formula, it only shows data and running total before today.

1.PNG

Thanks,
Angelia

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.