Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello together,
I have a datamodel, which contains sales and customers. In the visualisations I have a table with sales by customers.
Now I would like to calculate a running cumulative total for the prozentual sales per customer based on the total sales.
This I tried to do with an measure, as this table sales per customer should be filterable (e.g. choose different years).
This formular was working best for me so far, but I just get the % sales per customer based on total sales. and not the running total. Result should be something like this:
| Customers | Umsatz | Cumulative % Total | |
| Customer1 | x | 4,30% | 4,30% |
| Customer2 | y | 2% | 6,30% |
| Customer3 | z | 1,50% | 7,80% |
Solved! Go to Solution.
Hi @BenediktW
Based on the code you provided, you seem to be calculating the total sales and sales per customer correctly.
However, accumulating sales seems to be the problem. To calculate the running cumulative percentage, you need to make sure that the cumulative sales are calculating the cumulative values correctly in the table.
I made some simple changes to your code.
Here's some dummy data.
"Table"
Modified code:
Cumulative % Total =
var currentCustomer = MAX('Table'[Customers])
var TotalSales =
CALCULATE(
SUM('Table'[Sales]),
ALLSELECTED('Table')
)
var CumulativeSales =
CALCULATE(
SUM('Table'[Sales]),
FILTER(
ALLSELECTED('Table'),
'Table'[Customers] <= currentCustomer
)
)
RETURN DIVIDE(CumulativeSales, TotalSales)
Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @BenediktW
Based on the code you provided, you seem to be calculating the total sales and sales per customer correctly.
However, accumulating sales seems to be the problem. To calculate the running cumulative percentage, you need to make sure that the cumulative sales are calculating the cumulative values correctly in the table.
I made some simple changes to your code.
Here's some dummy data.
"Table"
Modified code:
Cumulative % Total =
var currentCustomer = MAX('Table'[Customers])
var TotalSales =
CALCULATE(
SUM('Table'[Sales]),
ALLSELECTED('Table')
)
var CumulativeSales =
CALCULATE(
SUM('Table'[Sales]),
FILTER(
ALLSELECTED('Table'),
'Table'[Customers] <= currentCustomer
)
)
RETURN DIVIDE(CumulativeSales, TotalSales)
Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Have you tried the new preview feature Visual Calculations? They provide a simpler way of calculating things like cumulative totals. You'll need to enable this preview feature in Power BI Desktop.
https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-visual-calculations-overview
Proud to be a Super User!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |