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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

Splitting column data

Hello

 

My problem is as follows:

I have data with a data assigned, with from to values that also is linked to a cost. The question I got asked is to "bin" the from to data into specific intervals with the associated costs then split according to these bins. Can this be done? 

I tried the bin option but it does not split on the precise interval. 

Thanks

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Try formula like below:

Create calculated column for grouping.

Bin = 
SWITCH(
    TRUE(),
    'DataTable'[FromValue] >= 0 && 'DataTable'[FromValue] <= 10, "0-10",
    'DataTable'[FromValue] > 10 && 'DataTable'[FromValue] <= 20, "11-20",
    'DataTable'[FromValue] > 20 && 'DataTable'[FromValue] <= 30, "21-30",
    'DataTable'[FromValue] > 30 && 'DataTable'[FromValue] <= 40, "31-40",
    "Other"
)

vkongfanfmsft_0-1716889748931.png

Then create below measure:

TotalCost = 
SUM('DataTable'[Cost])

vkongfanfmsft_1-1716889791526.png

Best Regards,
Adamk Kong

 

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
Anonymous
Not applicable

Hi @Anonymous ,

 

Try formula like below:

Create calculated column for grouping.

Bin = 
SWITCH(
    TRUE(),
    'DataTable'[FromValue] >= 0 && 'DataTable'[FromValue] <= 10, "0-10",
    'DataTable'[FromValue] > 10 && 'DataTable'[FromValue] <= 20, "11-20",
    'DataTable'[FromValue] > 20 && 'DataTable'[FromValue] <= 30, "21-30",
    'DataTable'[FromValue] > 30 && 'DataTable'[FromValue] <= 40, "31-40",
    "Other"
)

vkongfanfmsft_0-1716889748931.png

Then create below measure:

TotalCost = 
SUM('DataTable'[Cost])

vkongfanfmsft_1-1716889791526.png

Best Regards,
Adamk Kong

 

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

Ritaf1983
Super User
Super User

Hi @Anonymous 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.