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
Teaman
Frequent Visitor

Running total of complex measure

Hi All,

 

I have data and measure as below which returns the following table:

Teaman_0-1687776985468.png

The 'AVG per Day by month group' measure returns the total volume based on the day of the month and is the same for each month.

What I want is a running total for when a month is selected. If graphed against the date and May is selected, the graph will show a running total as below etc.

Teaman_1-1687777334647.png

 

I have tried several different types of running total measures and combinations but a lot of them are just returning the same 'AVG per Day by month group' value.  Note: This is just test data, my actual data source also includes a seperate date table.

Any Help is greatly appreciated.

Thank you!

(below measure works fine)

AVG per Day by month group =
VAR currDate =
    MAX ( Data[Date] )
RETURN
    CALCULATE (
        DIVIDE ( SUM ( Data[Volume] ), COUNTROWS ( VALUES ( Data[Date] ) ) ),
        FILTER (
            ALLSELECTED ( Data ),
            YEAR ( [Date] ) = YEAR ( currDate )
                && DAY([Date]) = DAY ( currDate )
        )
    )

Data table: 
Date, Product ID, Day of Month, Volume
01 March 2023110   
01 March 2023210   
01 April 2023110   
01 April 20232160   
01 May 20231110   
01 May 20232110   
02 March 2023125   
02 March 2023220   
02 April 20231230   
02 April 2023220   
02 May 20231220   
02 May 20232220   
03 March 2023135   
03 March 20232316   
03 April 20231320   
03 April 20232315   
03 May 2023138   
03 May 20232331   
5 REPLIES 5
Anonymous
Not applicable

Hi  @Teaman ,

 

Here are the steps you can follow:

1. Create measure.

Measure =
SUMX(
    FILTER(ALLSELECTED('Table'),    YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))&&MONTH('Table'[Date])=MONTH(MAX('Table'[Date]))&&'Table'[Date]<=MAX('Table'[Date])),[AVG per Day by month group])

2. Result:

vyangliumsft_0-1688457203400.pngvyangliumsft_1-1688457203404.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Hi @Anonymous 

 

Thanks for your response! When I use this with my actual data (which also includes a date table) it doesn't seem to work and instead shows the running total of Data[Volume] instead of the whole 'AVG per Day by month group' measure. I've tried other ways to calculate the running total of the above measure but it always seems to show the RT of Data[Volume] instead. Do you know what needs to change?

Note: my report also includes a Year-Month column which is used a s a filter on the page.

Thanks,

Mahesh0016
Super User
Super User

@Teaman Please share your Expected output in table !Thank You!!

Hi @Mahesh0016  ,

The below table is basically what I'm after. A running total of the 'AVG per Day by Month' measure that resets every month. The running total is going to be used with a month filter anyway so it doesn't really need to be grouped by month, it can just be a running total of all the data within the 'AVG per Day by month' measure.

Thank you

Teaman_0-1687781912487.png

 

@i HOPE THIS HELPS YOU!THANK YOU!!

 

Running Avg =
TOTALMTD ( SUM ( 'Table'[Avg] ), 'Table'[Date] )

 

Mahesh0016_0-1688618611896.png

Mahesh0016_1-1688618775756.png

 

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors