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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Aqil_Shah
Frequent Visitor

Spend Buckets

Hi All,

 

I wanted to create spend buckets for spend by Name. However, I do not want to categorize the bucket by each line instead it will read total spend then it classifies which bucket it falls to. Also, I wanted to  use as column instead of measure so that I can display the buckets in chart.

 

Please refer my mock data below

Aqil_Shah_0-1688454617864.png

 

This is what I wanted to display

Aqil_Shah_1-1688454681468.png

 

Thank you!

1 ACCEPTED SOLUTION
ValtteriN
Community Champion
Community Champion

Hi,

Here is one way to do this:

Bucket = var _sum = SUM('Table (32)'[Spend]) return

SWITCH(TRUE(),
_sum<50,"Less than 50",
_sum<100,"More than 50",
_sum>=100,"More than 100")

When placed in a table the result is like this:
ValtteriN_0-1688458327413.png

 

If you want a column here is an example of that:

Bucket_c = var _sum = CALCULATE(SUM('Table (32)'[Spend]),ALLEXCEPT('Table (32)','Table (32)'[Name])) return

SWITCH(TRUE(),
_sum<50,"Less than 50",
_sum<100,"More than 50",
_sum>=100,"More than 100")

ValtteriN_1-1688458531143.png

 


I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/






Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
v-jianboli-msft
Community Support
Community Support

Hi @Aqil_Shah ,

 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

 

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

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

ValtteriN
Community Champion
Community Champion

Hi,

Here is one way to do this:

Bucket = var _sum = SUM('Table (32)'[Spend]) return

SWITCH(TRUE(),
_sum<50,"Less than 50",
_sum<100,"More than 50",
_sum>=100,"More than 100")

When placed in a table the result is like this:
ValtteriN_0-1688458327413.png

 

If you want a column here is an example of that:

Bucket_c = var _sum = CALCULATE(SUM('Table (32)'[Spend]),ALLEXCEPT('Table (32)','Table (32)'[Name])) return

SWITCH(TRUE(),
_sum<50,"Less than 50",
_sum<100,"More than 50",
_sum>=100,"More than 100")

ValtteriN_1-1688458531143.png

 


I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/






Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @ValtteriN ,

 

That works like a charm! Thank you!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.