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
sparker95
Frequent Visitor

SUM values in a table and group into categories

I have a table called 'Costing' in this table I have columns 'Building & Work Stage ID' and 'Cost'. The ID column is a text column represent eahc project and then I have various values in the cost for each ID. I need to SUM the 'Cost' column for each ID creating a total project value. I then want to categorise these like I have attempted to below. However, I then want to create a table that provides a count of 'Building & Work Stage ID' for each 'Category'. When I try do this it just gives me a total count of IDs and all assigned to the £50m+ category.

 

 

 
Project Value £ Categories=
VAR ProjectCost = [Project Costs]
RETURN
SWITCH(TRUE(),
ProjectCost < 1, "No Data",
ProjectCost > 1 && ProjectCost <= 10000000, "£0-£10m",
ProjectCost > 10000000 && ProjectCost <= 30000000, "£10-£30m",
ProjectCost > 30000000 && ProjectCost <= 50000000, "£30-£50m",
"£50m+")
 
for reference
Project Costs =CALCULATE(SUM('Costing'[Cost]), VALUES('Costing'[Building & Work Stage ID]))
)
 
 
1 ACCEPTED SOLUTION

4 REPLIES 4
sparker95
Frequent Visitor

 I have a table that includes these columns (this is  a simplified version).

Building & Work Stage IDCost
Project 11000000
Project 15000000
Project 13000000
Project 250000000
Project 2600000
Project 1100000
Project 210000000
Project 35000000
Project 310000000
Project 415000000
Project 410000000

 

I then want to sum for each project

 Total Project Value
Project 1           9,100,000
Project 2         60,600,000
Project 3         15,000,000
Project 4         25,000,000


Finally I want to create a count of projects within specific size ranges, as per below.

 Count of Project
£0-10m1
£10-30m2
£30-50m0
£50m+1



lbendlin_0-1724417929543.png

 

This works, thank you!

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

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.