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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Yazid
Helper I
Helper I

Cumlative sum with only on specific rows (Yellow)

Dear,

I have the following table: 

Yazid_0-1716978218784.png

Where I'd like to create a column with the cumulative sum of the "YTD_Actuals_per_project" in fuction of specific rows for "Project_Act" (Marked in yellow)

 

Basically, I want to do a running sum for each new increment of "Project_Act", i.e for 1,2 and 3 .... And not taking duplicate.

 

Hope I was clear enough.

 

Thnaks in advance for your support.

3 REPLIES 3
Yazid
Helper I
Helper I

Hi @rajendraongole1 , thanks for your code ! Really appreciate your help. The code is working fine but not getting what I'm expecting. I was not clear enough, my bad. Here below an excel screenshot of what I'd like to do:

Yazid_0-1716985001440.png

 

DataNinja777
Super User
Super User

Hi @Yazid ,

As you know Power BI data model doesn't recognize your yellow highlighting 😀, so you need to write the condition to apply in your YTD calculation.  It appears in your data that in your Month field, "janvier 2024" numbers are highlighted except for the 1st item.  Is there any logical pattern in your highlighting of the numbers?  In that case, you need to convert that logic into the filter condition on which to apply your YTD calculation.  

Best regards,

rajendraongole1
Super User
Super User

Hi @Yazid - can you try the below logic to create a dax calcualted column

 

Cumulative_Sum_YTD_Actuals_per_project =
VAR CurrentProject = YourTable[Project_Act]
RETURN
CALCULATE (
SUM ( YourTable[YTD_Actuals_per_project] ),
FILTER (
ALL ( YourTable ),
YourTable[Project_Act] = CurrentProject &&
YourTable[YTD_Actuals_per_project] <> BLANK ()
/* Add any other conditions if needed */
),
YourTable[Project_Act] <= CurrentProject
)

 

Once you create the above calculated column in your Power BI data model, it will calculate the cumulative sum of YTD_Actuals_per_project based on specific rows for the Project_Act

 

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors