Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I am new Power BI and I need help with a DAX formula.
I would like a forumula that is a cumulative count of "Complete" in the Build Complete FC Status column against the Build Complete FC date columns - thank you 🙂
Solved! Go to Solution.
Hi @NessFlood ,
You can try the following DAX: Change ALL() to ALLSELECTED(), which can adjust with the changes in the filter.
The ALLSELECTED function gets the context that represents all rows and columns in the query, while keeping explicit filters and contexts other than row and column filters. This function can be used to obtain visual totals in queries.
ALLSELECTED function (DAX) - DAX | Microsoft Learn
CumulativeCompleteCount_Measure =
COUNTX(
FILTER(ALLSELECTED('CBR_REPORT'),
'CBR_REPORT'[Build Complete FC Status]="Complete"&&'CBR_REPORT'[BLD110 Build Complete FC]<=MAX('CBR_REPORT'[BLD110 Build Complete FC])),[Ref ID])
If dax gets results that don't match your expected results, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @NessFlood ,
You can try the following DAX: Change ALL() to ALLSELECTED(), which can adjust with the changes in the filter.
The ALLSELECTED function gets the context that represents all rows and columns in the query, while keeping explicit filters and contexts other than row and column filters. This function can be used to obtain visual totals in queries.
ALLSELECTED function (DAX) - DAX | Microsoft Learn
CumulativeCompleteCount_Measure =
COUNTX(
FILTER(ALLSELECTED('CBR_REPORT'),
'CBR_REPORT'[Build Complete FC Status]="Complete"&&'CBR_REPORT'[BLD110 Build Complete FC]<=MAX('CBR_REPORT'[BLD110 Build Complete FC])),[Ref ID])
If dax gets results that don't match your expected results, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
thank you - I changed to ALLSELECTED and realised that the visuals need to be drilled down also so I can see the full result 🙂
Hi @NessFlood ,
Are you referring to Meausure in the Total row not 13?You can use IF+ ISINSCOPE() to determine if it is the total row, customize the rule .
Here are the steps you can follow:
1. Create measure.
correct count =
IF(
ISINSCOPE('CBR_REPORT'[Ref ID]),[CumulativeCompleteCount_Measure],COUNTX(FILTER(ALLSELECTED('CBR_REPORT'),[CumulativeCompleteCount_Measure]<>BLANK()),[Ref ID]))
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi Liu
Your latest formula in purple does calculate in the column but not in the graph. I'm wanting a cumulative graph like the one on the left, which does work with the old formula except when I filter it by region. It should only return 13 completed build sites for Canterbury - pilot but keeps saying 17 and no cumulative line using the new purple formula. Again thanks for any help 😀
Thanks for the reply from aduguid , please allow me to provide some information to add:
Hi @NessFlood ,
According to the error message, you are using the table + column name 'CBR_REPORT' [BLD110 Build Complete FC] in allselect(), followed by 'CBR_REPORT' [Build Complete FC Status] which is not referenced in the dax equation
You can try the following DAX:
Measure:
CumulativeCompleteCount_Measure =
IF(
MAX([Build Complete FC Status])="Complete",
COUNTX(
FILTER(ALL('CBR_REPORT'),
'CBR_REPORT'[Build Complete FC Status]="Complete"&&'CBR_REPORT'[BLD110 Build Complete FC]<=MAX('CBR_REPORT'[BLD110 Build Complete FC])),[Ref ID]))
Caliculated Column:
CumulativeCompleteCount_Column =
IF(
[Build Complete FC Status]="Complete",
COUNTX(
FILTER('CBR_REPORT',
'CBR_REPORT'[Build Complete FC Status]="Complete"&&'CBR_REPORT'[BLD110 Build Complete FC]<=EARLIER('CBR_REPORT'[BLD110 Build Complete FC])),[Ref ID]))
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi there, the formulas works for the entire table but not when I filter by PSN Region.
Without filter
But with filter for Canterbury Pilot it should only total 13 but it totals 17?
thanks again for any help 🙂
Try this measure
CumulativeCompleteCount =
CALCULATE(
COUNTROWS(TableName),
FILTER(
ALLSELECTED(TableName[Build Complete FC Date]),
TableName[Build Complete FC Date] <= MAX(TableName[Build Complete FC Date]) &&
TableName[Build Complete FC Status] = "Complete"
)
)
Thank you, I tried but it didn't like the syntax, see below
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
9 | |
8 | |
8 | |
8 |
User | Count |
---|---|
13 | |
12 | |
11 | |
10 | |
9 |