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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
JST15
Helper I
Helper I

Help Creating a Waterfall Chart using Pareto 80/20 Principal

Good morning!

Waterfall_Excel 

Waterfall_PBIX  

 

I've been trying to recreate the Waterfall chart seen in the attached excel file. The goal is to use the Pareto principle, where 80% of effects come from 20% of the problems. In this example, I have a list of expenses where I compare actual results to their budget (plan) and calculate the variance. I rank the variances from largest to least difference to budget to both the positive and negative variances. I then take the cumulative sum of them divided by the total positive or negative variance to get a cumulative positive or negative percent. Once this percent gets to 80% it it labels any other expense as "Other". The waterfall should list the positive or negative expenses that fall in the top 80% and the remaining expenses are summed together and grouped as "Other". The formulas I use are in the excel file in the OE Waterfall MTD tab and the waterfall is in the OE Waterfall tab. 

I want to recreate this in a power bi report. My file is attached. My dataset uses three tables. One table holds the actuals, Second, the Budget (Plan) and a third relates the two using the Account numbers. I need all slicers to work. My approach was the create a virtual table that does variance and other metric calcualtions. I then created a Waterfall table to order my categories and but also to list the top 80% expense lines and separate the other 20% to Other. 

My problem is that I can only get the Actual, Plan and Other categories in the Waterfall. My metrics aren't working so that the top 80% expenses show in the waterfall and the other 20% show as other. 

Any help is greatly appreciated! Maybe my approach is flawed and there is an easier way?

 

Thank you!!!

1 ACCEPTED SOLUTION
DataNinja777
Super User
Super User

Hi @JST15 ,

 

Creating a dynamic waterfall chart in Power BI that visualizes the 80/20 Pareto principle for variance analysis is an excellent way to derive deep insights from your financial data. Your initial instinct to use a virtual table is understandable, but a more flexible and robust solution can be achieved by leveraging a series of DAX measures. This measure-based approach ensures your visuals react seamlessly to any slicer or filter applied to the report, providing a truly interactive experience. The strategy is to calculate the variance, rank the positive and negative variances separately, determine their cumulative contribution, and then dynamically group any accounts falling outside the top 80% into an "Other" category directly within the measures that power the chart.

First, you must establish the foundational measures for your actuals, planned amounts, and the variance between them. These form the basis for all subsequent calculations.

Total Actuals = SUM(Actuals[Actual Amount])
Total Plan = SUM(Budget[Plan Amount])
Variance = [Total Actuals] - [Total Plan]

With the core Variance measure created, the next step is to rank the accounts based on this variance. To handle both favorable and unfavorable variances correctly, you should create two separate ranking measures: one for positive variances, ordered descendingly, and another for negative variances, ordered ascendingly. Using ALLSELECTED is critical here, as it ensures the ranking dynamically adjusts to any active filters on your report page.

Positive Variance Rank =
RANKX(
FILTER( ALLSELECTED('Accounts'), [Variance] > 0 ),
[Variance],
,
DESC
)
Negative Variance Rank =
RANKX(
FILTER( ALLSELECTED('Accounts'), [Variance] < 0 ),
[Variance],
,
ASC
)

Now you can calculate the cumulative running total as a percentage of the total variance, which is the heart of the Pareto analysis. These measures will check the rank of the current account and sum up the variance for all accounts with an equal or better rank. This cumulative sum is then divided by the total positive or negative variance, respectively, to get the cumulative percentage.

Cumulative Positive Variance % =
VAR TotalPositiveVariance =
CALCULATE(
[Variance],
FILTER(ALLSELECTED('Accounts'), [Variance] > 0)
)
VAR CumulativePositiveVariance =
CALCULATE(
[Variance],
FILTER(
ALLSELECTED('Accounts'),
[Positive Variance Rank] <= [Positive Variance Rank] && [Variance] > 0
)
)
RETURN
DIVIDE(CumulativePositiveVariance, TotalPositiveVariance)
Cumulative Negative Variance % =
VAR TotalNegativeVariance =
CALCULATE(
[Variance],
FILTER(ALLSELECTED('Accounts'), [Variance] < 0)
)
VAR CumulativeNegativeVariance =
CALCULATE(
[Variance],
FILTER(
ALLSELECTED('Accounts'),
[Negative Variance Rank] <= [Negative Variance Rank] && [Variance] < 0
)
)
RETURN
DIVIDE(CumulativeNegativeVariance, TotalNegativeVariance)

Using these cumulative percentage measures, you can now define the categories for your waterfall chart's breakdown. The following Waterfall Category measure checks if an account's variance falls within the top 80% of either the positive or negative cumulative total. If it does, the account's name is returned; otherwise, it is labeled as "Other".

Waterfall Category =
IF(
OR(
[Cumulative Positive Variance %] <= 0.80,
[Cumulative Negative Variance %] <= 0.80
),
SELECTEDVALUE('Accounts'[Account]),
"Other"
)

Finally, you need a measure to supply the correct values to the waterfall chart. This measure will provide the standard Variance for individual accounts that are displayed. For the "Other" category, it calculates the sum of variances for all accounts that were grouped together, ensuring the waterfall totals remain accurate.

Waterfall Value =
SUMX(
SUMMARIZE(
'Accounts',
'Accounts'[Account],
"Category", [Waterfall Category],
"Value", [Variance]
),
IF(
[Category] = "Other",
CALCULATE(
[Variance],
FILTER(
ALL('Accounts'),
NOT(OR([Cumulative Positive Variance %] <= 0.80, [Cumulative Negative Variance %] <= 0.80))
)
),
[Value]
)
)

To construct the visual in your Power BI report, add a waterfall chart to the canvas. Place your Account field in the "Category" well. Drag the final Waterfall Value measure into the "Values" well. To group the items correctly, you will need to create a supporting column or use advanced filtering based on the Waterfall Category logic to show the individual accounts and the single "Other" bar. A common approach is to create a calculated table for the categories and relate it, but the measure-based logic provided here is often sufficient when combined with appropriate visual-level filters. Ensure the chart is sorted by the Variance measure in descending order to achieve the correct flow from largest to smallest impact.

 

This fully measure-driven approach is powerful because it is entirely dynamic. Any filter applied to the page, such as for a specific time period or business unit, will trigger a recalculation of all the measures. The ranking, cumulative percentages, and the "Other" group will all adjust automatically, providing a consistently accurate and insightful Pareto analysis of your variance data without any manual intervention.

 

Best regards,

View solution in original post

3 REPLIES 3
DataNinja777
Super User
Super User

Hi @JST15 ,

 

Creating a dynamic waterfall chart in Power BI that visualizes the 80/20 Pareto principle for variance analysis is an excellent way to derive deep insights from your financial data. Your initial instinct to use a virtual table is understandable, but a more flexible and robust solution can be achieved by leveraging a series of DAX measures. This measure-based approach ensures your visuals react seamlessly to any slicer or filter applied to the report, providing a truly interactive experience. The strategy is to calculate the variance, rank the positive and negative variances separately, determine their cumulative contribution, and then dynamically group any accounts falling outside the top 80% into an "Other" category directly within the measures that power the chart.

First, you must establish the foundational measures for your actuals, planned amounts, and the variance between them. These form the basis for all subsequent calculations.

Total Actuals = SUM(Actuals[Actual Amount])
Total Plan = SUM(Budget[Plan Amount])
Variance = [Total Actuals] - [Total Plan]

With the core Variance measure created, the next step is to rank the accounts based on this variance. To handle both favorable and unfavorable variances correctly, you should create two separate ranking measures: one for positive variances, ordered descendingly, and another for negative variances, ordered ascendingly. Using ALLSELECTED is critical here, as it ensures the ranking dynamically adjusts to any active filters on your report page.

Positive Variance Rank =
RANKX(
FILTER( ALLSELECTED('Accounts'), [Variance] > 0 ),
[Variance],
,
DESC
)
Negative Variance Rank =
RANKX(
FILTER( ALLSELECTED('Accounts'), [Variance] < 0 ),
[Variance],
,
ASC
)

Now you can calculate the cumulative running total as a percentage of the total variance, which is the heart of the Pareto analysis. These measures will check the rank of the current account and sum up the variance for all accounts with an equal or better rank. This cumulative sum is then divided by the total positive or negative variance, respectively, to get the cumulative percentage.

Cumulative Positive Variance % =
VAR TotalPositiveVariance =
CALCULATE(
[Variance],
FILTER(ALLSELECTED('Accounts'), [Variance] > 0)
)
VAR CumulativePositiveVariance =
CALCULATE(
[Variance],
FILTER(
ALLSELECTED('Accounts'),
[Positive Variance Rank] <= [Positive Variance Rank] && [Variance] > 0
)
)
RETURN
DIVIDE(CumulativePositiveVariance, TotalPositiveVariance)
Cumulative Negative Variance % =
VAR TotalNegativeVariance =
CALCULATE(
[Variance],
FILTER(ALLSELECTED('Accounts'), [Variance] < 0)
)
VAR CumulativeNegativeVariance =
CALCULATE(
[Variance],
FILTER(
ALLSELECTED('Accounts'),
[Negative Variance Rank] <= [Negative Variance Rank] && [Variance] < 0
)
)
RETURN
DIVIDE(CumulativeNegativeVariance, TotalNegativeVariance)

Using these cumulative percentage measures, you can now define the categories for your waterfall chart's breakdown. The following Waterfall Category measure checks if an account's variance falls within the top 80% of either the positive or negative cumulative total. If it does, the account's name is returned; otherwise, it is labeled as "Other".

Waterfall Category =
IF(
OR(
[Cumulative Positive Variance %] <= 0.80,
[Cumulative Negative Variance %] <= 0.80
),
SELECTEDVALUE('Accounts'[Account]),
"Other"
)

Finally, you need a measure to supply the correct values to the waterfall chart. This measure will provide the standard Variance for individual accounts that are displayed. For the "Other" category, it calculates the sum of variances for all accounts that were grouped together, ensuring the waterfall totals remain accurate.

Waterfall Value =
SUMX(
SUMMARIZE(
'Accounts',
'Accounts'[Account],
"Category", [Waterfall Category],
"Value", [Variance]
),
IF(
[Category] = "Other",
CALCULATE(
[Variance],
FILTER(
ALL('Accounts'),
NOT(OR([Cumulative Positive Variance %] <= 0.80, [Cumulative Negative Variance %] <= 0.80))
)
),
[Value]
)
)

To construct the visual in your Power BI report, add a waterfall chart to the canvas. Place your Account field in the "Category" well. Drag the final Waterfall Value measure into the "Values" well. To group the items correctly, you will need to create a supporting column or use advanced filtering based on the Waterfall Category logic to show the individual accounts and the single "Other" bar. A common approach is to create a calculated table for the categories and relate it, but the measure-based logic provided here is often sufficient when combined with appropriate visual-level filters. Ensure the chart is sorted by the Variance measure in descending order to achieve the correct flow from largest to smallest impact.

 

This fully measure-driven approach is powerful because it is entirely dynamic. Any filter applied to the page, such as for a specific time period or business unit, will trigger a recalculation of all the measures. The ranking, cumulative percentages, and the "Other" group will all adjust automatically, providing a consistently accurate and insightful Pareto analysis of your variance data without any manual intervention.

 

Best regards,

Ahhhhh, this makes sense. Thank you! This is working as expected. I was so stick on needing a virtual table which just wasn't working. Amazing and thank you for all the help!!

amitchandak
Super User
Super User

@JST15 , if you need other, then you need dynamic segmentation like I have done here 

Power BI ABC Analysis using Window function, Dynamic Segmentation: https://youtu.be/A8mQND2xSR4

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.