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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Cumulative Sum on Text Field

Hi,

I am trying to present a cumulative sum by priority and project with the two being a concatenated field in a separate table.

 

Example. (Priority Initiative)

1-Warehouse

2-Field

3-Retail

11-Other

 

Sales Data

Priority 1 50

Priority 11 -200

 

 

 

I am trying to capture the sales and other data such that I can sort the matrix by the priority intiative and have it calculate correctly.

 
I am using this as my measure but it does not calculate correctly
 Running Total =
CALCULATE(
   sum('Sales'[Total Sales]),
    FILTER(
        ALLSELECTED('Priority Intiative'[Priority]),
        ISONORAFTER('Priority Intiative'[Priority], MAX('Priority Intiative'[Priority]), DESC)
    )
)

Thanks for your help. 

 

 

1 ACCEPTED SOLUTION

@Anonymous 

Please check the attached file:

Running Total = 
CALCULATE(
    [Total Sales],
    'Sales Table'[Priortiy] <= MAX( 'Priority Table'[Priority] ),
    ALLSELECTED( 'Priority Table' )   
)

 

Fowmy_0-1703276462345.png

 


 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

9 REPLIES 9
Fowmy
Super User
Super User

@Anonymous 

Modify your measure as follows. I assume you have includedonly the 'Priority Intiative'[Priority Int] on the Row section of the matrix, that's way I removed the filters using REMOVEFILTER, if you have added more columns from the same table, please include them as well.



Running Total = 
CALCULATE(
   sum( Sales[Total Sales]),
      'Priority Intiative'[Priority] <=  MAX('Priority Intiative'[Priority]),
      REMOVEFILTERS( 'Priority Intiative'[Priority Int] )      
)

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Thanks!  I am still runnning into this thing where it doesn't carry the value down. My Priority table only has the Int field and the priority number.  Any thoughts? 

bcobrien1977_1-1703266545244.png

 

@Anonymous 

Try this measure, if it doesn't work, please share a dummy PBI file that represents your secenario. Save it in Google Drive and share the link here.

Running Total = 
CALCULATE(
   sum( Sales[Total Sales]),
      'Priority Intiative'[Priority] <=  MAX('Priority Intiative'[Priority]),
      REMOVEFILTERS( 'Priority Intiative')      
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

https://drive.google.com/file/d/1k1M3yCb-4z1e_mF0hAT28SpeY3vdrX2P/view?usp=drive_link 


Hi, if you look at Team B, there is 592 for one priority and one for a second one. I would expect the cumulative to be 592 until the next one kicks in to make it 1192.  I need this to work with text though. 

Hi, 

the shared file is different and does not reflect the number as you mentioned please share the file again. Create sample data and remove sensitive information. 

@Anonymous 

Please check the attached file:

Running Total = 
CALCULATE(
    [Total Sales],
    'Sales Table'[Priortiy] <= MAX( 'Priority Table'[Priority] ),
    ALLSELECTED( 'Priority Table' )   
)

 

Fowmy_0-1703276462345.png

 


 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

saudansari
Helper II
Helper II

So do your columns have numbers only or both numbers and text If yes, I recommend using a split column in Power Query and the sum with DAX. If this is not helping I will recommend creating a sample data and sharing the file with us to remove sensitive data 

Anonymous
Not applicable

Hi, here is how things look....  Thanks!

 

Sales Table     
PriortiySalesTeam   
150A   
11200A   
375B   
250B   
      
Priority Table     
PriorityPriority Int    
11-Warehouse    
22-Field    
33-Retail    
1111-Other    
      
      
Desired     
 Team A SalesTeam A CumulativeTeam BTeam B Cumulative
      
1-Warehouse5050   
2-Field 505050 
3-Retail 5075125 
11-Other200250   
Total250250125125 

Try This hope this help

https://drive.google.com/file/d/1k1M3yCb-4z1e_mF0hAT28SpeY3vdrX2P/view?usp=drivesdk


please make sure there is a relationship between the 'Priority' field in the 'Priority Table' and the 'Priority' field in the 'Sales Table'.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

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