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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
PowerBIoverExcl
Frequent Visitor

Waterfall chart with Top N / Bottom N sales based on slicer

Dear PowerBI Community,

 

Despite having checked multiple threads on applicable DAX formula’s I can’t seem to find the correct solution for what I’m searching for. I would greatly appreciate it if someone could help me.

 

For a data source, I have a single dataset of customer names, time periods and sales values. I want to setup a waterfall chart whereby between the totals, I want to show the top-5 gainers in sales, top-5 declines in sales and have the sales change of all other customers grouped together in ‘Others’. I verified that this can only be achieved using DAX formulas (i.e. not with just visualisation options).

 

The thing that complicates this is that I have a slicer whereby the user can select any (2 or more) time periods, so the DAX formula needs to be dynamic to accommodate any combination of time periods.

 

Would appreciate any DAX help.Overview.PNG

3 REPLIES 3
Anonymous
Not applicable

Hi @PowerBIoverExcl  ,

 

You can create a measure, measures can change dynamically with filtering

Measure = SUM('Table'[Sales])

Then create the Waterfall chart and put the following fields in visual filter, ‘shown items’ select Top 6 , and put the measure to the ‘By value’, then click ‘Apply filter’

vxinruzhumsft_0-1669874261426.png

 

 

Then change the “Breakdown”  in format, input  “5”

vxinruzhumsft_1-1669874261430.png

 

 

The final output

 

vxinruzhumsft_2-1669874261432.png

 

Best Regards,

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Yolo Zhu,

 

Thanks for the response, but this method does not produce the result I’m looking for. I want to show the largest 5 customers individually, as well as the bottom-5 individually by sales, and have the effects of all other customer grouped in a subtotal ‘Others’. Furthermore, applying the filter to the Top N also affects the results of the totals in the waterfall bridge, whereas I would like the totals to include the total of all customers for the selected time periods.

 

I created the following DAX measures to help me sort which impacts to show separately:

  • Total_Revenue = SUM(Combined[Revenue])
  • Total_GP = SUM(Combined[Gross profit])
  • Concentration_Rank = RANKX(ALL(Combined[Customer]),SUMX(Combined,Combined[Revenue]))
  • Concentration_Display_Names = IF(Combined[Concentration_Rank]>10,"Other",0)

Data.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

However, I cant make them work. Could anyone help me further?

Anonymous
Not applicable

Hi @PowerBIoverExcl 

 

You can try the following code:

SUM_RE_Bytime&Customer =
SUMX(FILTER(ALL('Table'),'Table'[Customer]=SELECTEDVALUE('Table'[Customer])&&'Table'[Time period]=SELECTEDVALUE('Table'[Time period])),[Revenue])
Type = var a= RANKX(FILTER(ALL('Table'),'Table'[Time period]=SELECTEDVALUE('Table'[Time period])),[SUM_RE_Bytime&Customer]) return if(a>=10,"other",0)
 
vxinruzhumsft_0-1669972508703.png

 

Best Regards,

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.