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
diskman
Regular Visitor

DAX - Running Total on measure by month index (column)

Hi

 

I have a dynamic table "table" (created by SUMMARIZE function based on other table) with fields:

  • "MonthIndex" - column
  • "MonthName" - column
  • "Forecast%" - measure which depends on some slicer and switch statements

 

 

table = 
SUMMARIZE (
    'Calendar New',
    'Calendar New'[Month],
    'Calendar New'[MonthIndex]
    )

 

 

 

 

I am trying to set up a running total "x" of "Forecast%" by "MonthIndex" but the runing total does not work - see screenshot.

 

x = CALCULATE (      
   'table'[Forecast%],      
   FILTER (      
      ALL ( 'table'[MonthIndex] ),      
      'table'[MonthIndex] <= MAX ( 'table'[MonthIndex] )  
   )    
)  

 

2021-10-25_18h05_10.png

 

Looking for any ideas

 

regards

1 ACCEPTED SOLUTION

@smpa01this has worked for me

 x = 
    SUMX(
        FILTER(
            ALL('table'),
            'table'[MonthIndex] <= MAX ( 'table'[MonthIndex] )
        ),
        'table'[Forecast%]
    )

View solution in original post

5 REPLIES 5
smpa01
Super User
Super User

@diskman  any chance you can provide a sample pbix?

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

@smpa01sorry the pbix has commercial data related 😞

@diskman  How did you write 

[Forecast%]
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

@smpa01  it is as below ... AFAIK It must use the measure because there is visual slicer used "Preference %" for measure calculation

Forecast % = (IF(MIN('table'[MonthIndex])=1,'Preference %'[Preference % Value], (33-'Preference %'[Preference % Value])/11))/100
 

@smpa01this has worked for me

 x = 
    SUMX(
        FILTER(
            ALL('table'),
            'table'[MonthIndex] <= MAX ( 'table'[MonthIndex] )
        ),
        'table'[Forecast%]
    )

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