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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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