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

Creating a running total with values from a measure

I've created a measure to get to certain values, after that I want the outcome of this measure in a running total, can't get to a solution. Any suggestions?

 

This is what I'm working with:

Run Tot.png

4 REPLIES 4
amitchandak
Super User
Super User

With a date calendar try

Cumm  = CALCULATE(SUM([Weight (ad)]),filter(date,date[date] <=maxx(date,date[date])))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

 

Thank you for the quick response but the suggested measure doesn't seem to work.

Most likely due to the fact that Weight (add) is aready a measure by itself. Any suggestions on how to resolve this?

 

Cumm  = CALCULATE(SUM([Weight (ad)]),filter(date,date[date] <=maxx(date,date[date]))) 

Can you share sample data and sample output. 

@amitchandak Unfortunately it's not possible to share the dataset since I'm working directly with the data from our ERP database.


Perhaps some idditional info can be of help:

 

Table - Value_posts

Column: Article

Column: Quantity

Column: Adjustment (this is a checkbox within the ERP and translates to 0 or 1)

Column: Weight

Column: Posting date

Measure: Weight (add)

Weight (add) = -1*CALCULATE(SUM('Value_posts'[Weight]);'Value_posts'[adjustment]=0)

 

Table:Date

This is just a regular date table (incl hirarchy)

 

What I'm looking for is a matrix with a running total on the measure "weight (add)" per month / year.

 

Calendar year      JAN      FEB     MARCH    APRIL   ETC

2017

2018

2018

 

Both years and months come from the date table and the values presented should  come from the Weight add measure. Presented as a running total.

 

Hope this info can be of help.

 

Thanks in advance.

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.