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
tobiasmcbride
Helper III
Helper III

Creating new category using data from two excel

I have some budget and actuals data for various categories (these categories are the same across the two datasets):

 

CategoryBudgetActuals
Direct Staff Costs£XXX£xxx
Indirect Staff Costs£XXX£xxx
Bonus £xxx£xxx
Travel£xxx£xxx
Marketing£xxx£xxx

 

The budget and actuals data are pulled from two different Excel spreadsheets but as the categories are common we can get them to match up.

 

However when presenting this in the report, I'd like to combine the 3 staff costs (Direct, Indirect & Bonuses) above into a new category called 'Staff Costs' alongside the other costs we have above. This would be across the Budget and Actuals dataset.

 

How is it best to do this and combine those 3 categories together? 

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

Hi @tobiasmcbride ,

 

Please create a new calculated table as below to work on it.

Table = 
ADDCOLUMNS (
    DISTINCT ( UNION ( VALUES ( Actuals[Category] ), VALUES ( Budget[Category] ) ) ),
    "NEW", IF (
        [Category] IN { "Direct Staff Costs", "Indirect Staff Costs", "Bonus" },
        "Staff Costs",
        Actuals[Category]
    )
)

2.PNG

After that, make the relationships between tables like that.

Capture.PNG

 

Pbix as attached.

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @tobiasmcbride ,

 

Please create a new calculated table as below to work on it.

Table = 
ADDCOLUMNS (
    DISTINCT ( UNION ( VALUES ( Actuals[Category] ), VALUES ( Budget[Category] ) ) ),
    "NEW", IF (
        [Category] IN { "Direct Staff Costs", "Indirect Staff Costs", "Bonus" },
        "Staff Costs",
        Actuals[Category]
    )
)

2.PNG

After that, make the relationships between tables like that.

Capture.PNG

 

Pbix as attached.

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
jherralo95
Frequent Visitor

Hi @tobiasmcbride!

You can try to create an additional column in the Excel file or create a custom columns in Power BI with the following code:

 

 

Column = IF(
            OR('TableName'[Category]="Direct Staff Costs";
               OR(
               'TableName'[Category]="Indirect Staff Costs";
               'TableName'[Category]="Bonus"
               )
            );
             "Staff Costs";
             'TableName'[Category]
           )

 

 

Captura.PNG

 
 

 

Helpful resources

Announcements
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.