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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
joshua1990
Post Prodigy
Post Prodigy

Running Total until Today

Hi all!

I have a bar chart that shows me the forecast for the whole month, as a running total value.

Then I have the actual sales also shown in the same bar chart.

I use this Dax formula to get a running total for the sales:

Sales RT MTD = 
CALCULATE(
    SUMX(
        'Calendar',
        [Sales]
    ),
    FILTER(
        ALL( 'Calendar' ),
        'Calendar'[Year]
            = VALUES( 'Calendar'[Year] )
            && 'Calendar'[Month Num]
                = MAX( 'Calendar'[Month Num] )
            && 'Calendar'[Date]
                <= MAX( 'Calendar'[Date] )
    )
)

 

Unfortuantely this measure displays the sales for the full month and not just for that past. The running total sales rate as of today is displayed for the future.

How can I filter the measure above to get values until today?

Please note the is a second measure in the same bar chart that shows the forecast for the future. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @joshua1990 ,

 

Please try below dax formula

Sales RT =
CALCULATE (
    SUM ( Sale[Sales] ),
    FILTER (
        ALL ( 'Date' ),
        'Date'[Date] <= MAX ( 'Date'[Date] )
            && 'Date'[Date] <= TODAY ()
    )
)

vbinbinyumsft_0-1658716610665.png

 

My test table:

Date:

vbinbinyumsft_1-1658716629522.png

Sale:

vbinbinyumsft_2-1658716645275.png

Mode:

vbinbinyumsft_3-1658716663356.png

 


Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @joshua1990 ,

 

Please try below dax formula

Sales RT =
CALCULATE (
    SUM ( Sale[Sales] ),
    FILTER (
        ALL ( 'Date' ),
        'Date'[Date] <= MAX ( 'Date'[Date] )
            && 'Date'[Date] <= TODAY ()
    )
)

vbinbinyumsft_0-1658716610665.png

 

My test table:

Date:

vbinbinyumsft_1-1658716629522.png

Sale:

vbinbinyumsft_2-1658716645275.png

Mode:

vbinbinyumsft_3-1658716663356.png

 


Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@joshua1990 , Try like

 

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'),'Date'[date] <=max('Date'[date]) && 'Date'[date]<= today()  ))

 

or

 

Cumm Sales = if(max('Date'[Date]) <= Today() , CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'),'Date'[date] <=max('Date'[date]))) , blank() )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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