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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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/
v-rongtiep-msft
Community Support
Community Support

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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