If you’re a business (or data) analyst, you’ve probably come across the cumulative sum. The cumulative sum is the cumulative total of a series of values like revenue (or sales) over a period of time.
Cumulative sums play a vital role in a variety of contexts like financial reporting and trend analysis. Using cumulative sum, you can easily track progress and identify patterns in your data.
This guide will help fully understand what the Power BI cumulative sum is, why you should use the cumulative sum in Power BI, and the importance of using Power BI running total.
First…
Power BI cumulative sum is the running total of a measure across a specified order, and it’s based on the date or a specific column. It reflects the sum of values accumulated over time (or within a defined grouping).
DAX is used to create a cumulative sum in Power BI. You’ll have to take advantage of functions like CALCULATE, SUM, and FILTER. For instance:
CumulativeSales = CALCULATE(SUM(’Sales’[Amount]),FILTER(ALL(’Calendar’),’Calendar’[Date] ← MAX(’Calendar’[Date]))).
Here:
Using a cumulative sum (also known as a running total) in Power BI provides a powerful way to analyze and visualize data over time or across categories. Here are some key reasons to use it:
To calculate the running total (or cumulative sum) in Power BI, you typically use DAX (Data Analysis Expressions) in either a calculated column or a measure. Here’s a step-by-step guide:
CumulativeSales= CALCULATE(SUM(’Sales’[Amount]),FILTER(ALL(’Calendar’),’Calendar’[Date] ← MAX(’Calendar’[Date])))
The formula calculates the running total of the “Amount” column. It sums the values where the date is less than (or equal) to the maximum date in the current context.
Evaluating a cumulative sum in Power BI involves creating a DAX measure using the CALCULATE and FILTER functions. Use data visualizations like line charts (or stacked column charts) to display the cumulative growth or total over time. This helps in enhancing data analysis and decision-making.
Example:
If you want the CUM Sales for the data below:
You’ll have to select New Quick Measure. After that, navigate to Totals —> Running total to create this:
Returns:
Total Cost | Company Type | Company Name | Expertise Categories | Expertise | Cost |
Total Cost | Subcontractor | Skyline Contractors | Mechanical Installation | Plumbing & Heating | 15456 |
Total Cost | Subcontractor | Skyline Contractors | Mechanical Installation | Mechanical Work | 10159 |
Total Cost | Subcontractor | Onyx General Contractors | Mechanical Installation | Plumbing & Heating | 18045 |
Total Cost | Subcontractor | Onyx General Contractors | Mechanical Installation | Mechanical Work | 12695 |
Total Cost | Subcontractor | Living Well Remodeling | Mechanical Installation | Plumbing & Heating | 14589 |
Total Cost | Subcontractor | Living Well Remodeling | Mechanical Installation | Welding | 11456 |
Total Cost | Supplier | Power-up Builders | Raw Material | Cement | 20561 |
Total Cost | Supplier | Power-up Builders | Raw Material | Steel | 32456 |
Total Cost | Supplier | Five-star Construction | Raw Material | Bricks | 10253 |
Total Cost | Supplier | Five-star Construction | Raw Material | Timber | 9000 |
The following video will help you create a Sankey Chart in Microsoft Power BI.
Using Power BI cumulative sums effectively requires leveraging DAX, proper visualization practices, and smart data modeling. Here are some tips and tricks to help you make the most out of cumulative sums in Power BI:
To find the cumulative sum in Power BI, you’ll have to create a new measure using DAX. For instance, CumulativeSales = CALCULATE(SUM(’Sales’[Amount]), FILTER(ALL(’Sales’), ‘Sales’[Date] ← MAX(’Sales’[Date]))).
To add a cumulative line in Power BI, create a line chart with a date field on the axis. Use a cumulative sum measure, like CumulativeSales = TOTALYTD(SUM(’Sales’[Amount]), ‘Sales’[Date]).
Power BI cumulative sums are used to track running totals over time. That helps to reveal trends, progress towards goals, and overall patterns.
To get the most out of Power BI cumulative sums, you’ll have to follow DAX patterns and best practices. This will enable you to write efficient and maintainable cumulative sum formulas. You should also consider using variables, and avoid unnecessary recalculations. Always organize your code for clarity.
Furthermore, you have to verify the accuracy of your cumulative sum calculations. That can be done by performing manual checks or comparing results with known values. This way, your calculations will align with your expectations.
Data (and business) analysts who combine cumulative sums with other relevant metrics will most likely have a comprehensive view of their data. This will, in turn, enhance the insights gained from the analysis.
Now you know how to create a cumulative sum using DAX in Power BI, what kind of visualization will you be using to represent your data?