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

Cumulative Sum doesn't consider blank values

Hi Team,

In my Power BI project, I'm facing an issue related to Cumulative Lead counts for quarterly data at the Rep level. I've managed to calculate the cumulative counts successfully, but there's an issue with handling weeks where no values exist. To clarify, when certain weeks between Week 1 to 13 have no leads assigned, my DAX measure returns a blank instead of considering them in the calculation. How can I address this issue?
 
Please find the below snip.
 
prasanna11289_0-1693807988251.jpeg

 

In the table on the left, you'll see a standard total, while the one on the right represents a cumulative total. On row number 2, my ideal outcome would be for 2024-w28 to display the number 64 as well. However, it currently returns a blank value because there is no W28 record for the specified rep.
 
Here is the DAX I used for this measure -
 
Cumulative_Lead_Count =
SUMX(
VALUES(SoapData[lead_owners_nm]), -- Iterate through unique lead_owners_nm values
IF(
ISBLANK(MAX(SoapData[fisc_quater_val])) ||
ISBLANK(MAX(SoapData[fisc_wk_end_dt])) ||
ISBLANK(MAX(SoapData[fisc_wk_val])),
BLANK(),
CALCULATE(
DISTINCTCOUNT(SoapData[lead_id]),
FILTER(
ALLSELECTED(SoapData),
SoapData[fisc_quater_val] <= MAX(SoapData[fisc_quater_val]) &&
SoapData[lead_owners_nm] = EARLIER(SoapData[lead_owners_nm])
)
)
)
)
2 REPLIES 2
USER99
Regular Visitor

I was having the same problem and what solved it for me was removing the relationships with any ambiguous path between the Calendar and the Date column. Put all relationships to the Calendar as uni-directional. It means that the fact that there is no value in a month in your base, doesnt make that month to be not filtered in the Calendar. Try it!

amitchandak
Super User
Super User

@prasanna11289 , You should create a rank column on YYYYWW column

 

Have these new columns in Date Table, Week Rank is Important in Date/Week Table

Week Rank = RANKX('Date','Date'[Week Start date],,ASC,Dense)
OR
Week Rank = RANKX('Date','Date'[Year Week],,ASC,Dense) //YYYYWW format

 

 

then have a measure like this or use Windows function

 

Example

 

CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]<=max('Date'[Week Rank])))

 

Continue to explore Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc
https://medium.com/@amitchandak/power-bi-window-function-3d98a5b0e07f

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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