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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Balapradeep
Frequent Visitor

Creating custom buckets for spend amount

Happy New Year 2022!!

 

I have a data like this, I need spend buckets that says if the running spend % is with in 25% then it should be "1_Top 25" else....

I should be able to change the row lables to some other filed but the buckets should works the same way based on column total.

Can anyone help me DAX functio

Balapradeep_0-1641284825651.png

 

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @Balapradeep ,

According to your description, in your snapshot, the [cummilative spend%] is calculated according to the value of [Sum of Spend Amount] from large to small, if it is like this, here's my solution.

Create two measures.

Cummilative spend % =
SUMX (
    FILTER (
        ALL ( 'Table' ),
        'Table'[Sum of Spend Amount] >= MAX ( 'Table'[Sum of Spend Amount] )
    ),
    'Table'[Sum of  Spend Amount 2]
)
Spend bucket =
SWITCH (
    TRUE (),
    [Cummilative spend %] <= 0.25, "1_Top 25",
    [Cummilative spend %] > 0.25
        && [Cummilative spend %] <= 0.5, "2_25-50"
)

 Get the expected result.

vkalyjmsft_0-1641549363281.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

 

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

 

View solution in original post

2 REPLIES 2
v-yanjiang-msft
Community Support
Community Support

Hi @Balapradeep ,

According to your description, in your snapshot, the [cummilative spend%] is calculated according to the value of [Sum of Spend Amount] from large to small, if it is like this, here's my solution.

Create two measures.

Cummilative spend % =
SUMX (
    FILTER (
        ALL ( 'Table' ),
        'Table'[Sum of Spend Amount] >= MAX ( 'Table'[Sum of Spend Amount] )
    ),
    'Table'[Sum of  Spend Amount 2]
)
Spend bucket =
SWITCH (
    TRUE (),
    [Cummilative spend %] <= 0.25, "1_Top 25",
    [Cummilative spend %] > 0.25
        && [Cummilative spend %] <= 0.5, "2_25-50"
)

 Get the expected result.

vkalyjmsft_0-1641549363281.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

 

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

 

amitchandak
Super User
Super User

@Balapradeep , This need segmentation using an independent table, I tried for Margin % measure. See if the same can work for cumulative %

 


Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1...


Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors
Top Kudoed Authors