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
Anonymous
Not applicable

Running Total - DAX

Hi all,

 

I have an issue calculating running totals.

We use a matching chance metric to calculate a forecast. 

 

 

Matching chance Job level = SUMX(VALUES(Table[column1]) ; CALCULATE(MAX(Table[column2])))

 

 

Now we want to calculate running totals on the level of account and date (year/month). And we made this DAX formula:

 

 

Running Total = CALCULATE(SUM(Table1[columnA]); FILTER(ALL(Table1); Table1[Date] <= MAX(Table1[Date])); VALUES(Table2[columnA]); VALUES(Table1[columnB]))

 

 

YearMonthMatching chance Job levelRunning Total
2016October11,00
2016November1,42,00
2016December0,41,90
2017January13,00
2017February0,53,10
 TOTAL4,404,40

 

 

Any ideas would be much appericated.  Thanks for any and all help in advance!

 

1 ACCEPTED SOLUTION

Running Total = CALCULATE(SUM(Table1[columnA]); FILTER(ALL(Table1); Table1[Date] <= MAX(Table1[Date])),FILTER(ALLSELECTED(Table2[columnA]),Table2[columnA]=Table2[columnA]),FILTER(ALLSELECTED(Table1[columnB]),Table1[columnB]=Table1[columnB]))


Then try this way in order to make filter works

View solution in original post

4 REPLIES 4
FarhanAhmed1984
Resolver III
Resolver III

Formula Looks good not sure if VALUES are helping out in this case. Try remove those and see if you are able to do calculations as desired.

 

Running Total = CALCULATE(SUM(Table1[columnA]); FILTER(ALL(Table1); Table1[Date] <= MAX(Table1[Date])))
Anonymous
Not applicable

Thanks for your response @FarhanAhmed1984. I think I need to include the VALUES because I want to filter my visual based on Account (name) and Position (status). Or do you see another option?

Running Total = CALCULATE(SUM(Table1[columnA]); FILTER(ALL(Table1); Table1[Date] <= MAX(Table1[Date])),FILTER(ALLSELECTED(Table2[columnA]),Table2[columnA]=Table2[columnA]),FILTER(ALLSELECTED(Table1[columnB]),Table1[columnB]=Table1[columnB]))


Then try this way in order to make filter works

Anonymous
Not applicable

Hi @FarhanAhmed1984 Thank you very much. 

The provided solution worked indeed. 

 

Ronald

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.

Top Solution Authors