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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
superpowerteam
Frequent Visitor

Running Total for an Average Dax Measure.

Hi guys, 

I am getting nuts, about this litte problem and I think you experts outside know the answer very fast. 

 

My dataset:

 

superpowerteam_0-1687956573969.png

 

I created a measure which uses the Week-Offest from the Date Table to select only the last 12 weeks of the dataset. 

 

superpowerteam_1-1687957248972.png

 

So far so good. When I select from the Date Table the "Short Day Name" and put the "AVG 12 weeks" measure in a table everthing works fine. 

 

superpowerteam_2-1687957365078.png

Now there comes my probelm: I want to do a running total of the average values for MO, DI ,MI a.s.o. 

 

I created a measure which should calculate a non-date running total based on the "Day of week Number" which I have in my time table and display it for the Day Name Short (MO, DI, MI a.s.o). As you can see the running totals are not running. My expectation was that: 

Mo 47,27

Di 90,08

Mi 143,88 a.so. 

 

superpowerteam_3-1687957586533.png

What I am doing wrong? Urgent help is needed 
Thanks in advance

 

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @superpowerteam ,

Please have a try. Modify the measure.

rt avg =
VAR reihenfolge =
    SELECTEDVALUE ( DimDates[Days of week number] )
RETURN
    SUMX (
        FILTER (
            ALLSELECTED ( DimDates ),
            DimDates[Days of week number] <= reihenfolge
        ),
        [AVG 12 Weeks]
    )

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

Hi, 

thank you for the code. Unfortunately you code is not working. As you can see your code delivers the result which I marked with the red cross. The result should be as  you can see in the prepared column. 

 

Any other ideas? 

 

superpowerteam_0-1688116825204.png

 

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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