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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

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