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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Salvetti_01
Regular Visitor

Payroll Grouping Question

Sample Payroll Grouping Excel

Hi everyone,

 

I could use some help with a report I'm trying to build to group employee salaries by specific groups. The link above is a sample data model I'm working with. Any help would be greatly appreciated!


Problem:
I need to reconcile payroll reports across multiple group cost centers. Employees can either be homed in a specific group or external to our groups and assigned to another department within the organization. The challenge I'm having is with employees homed in one group and paid by another.

 

I'm wondering what the best approach is to solve this (Power Query or DAX)?

 

Payroll_Actual is composed of two reports:
Payroll by fund: displays all employees charging one of the group funds, whether or not they are homed in the group.
Payroll by Home Cost Center: displays all salary sources for employees homed in a group, regardless of whether the funding comes a group fund or another department.

 

Desired Report:
I would like to create a report that can be filtered by group and provides:
All salaries charged to a specific group fund (PD_Fund).
All employees homed in the group (PD_HCC) but charging salaries to other department funds.
When the filter is removed, I don't want to double count those homed in one group and charging another group.

 

Current Report:
The current report works when the slicer is All, Apple, or Orange.
When group is Home Group, I don't see all the groups (Apple and Orange are filtered out)

1 ACCEPTED SOLUTION

Thanks Ashish. Disconnecting the tables was helpful. In addition, some DAX was needed.

Earning Amount =
VAR SelectedGroup = SELECTEDVALUE(Groups[Group])
VAR SelectedCostCenter = LOOKUPVALUE(Groups[Group Cost Center],Groups[Group], SelectedGroup)

RETURN
CALCULATE(
    SUM('Actual_Payroll'[Earnings Amount]),
    FILTER(
        Actual_Payroll,
        Actual_Payroll[Charged Cost Center] = SelectedCostCenter
        || Actual_Payroll[Home Cost Center] = SelectedCostCenter
    )
)

View solution in original post

4 REPLIES 4
Salvetti_01
Regular Visitor

Thanks @Ashish_Mathur for letting me know about the file access. Here is the link to an Excel file. I'm working on the PBI file to share as well.  Below are the tables of my data model and the report I currently have.

 

This table shows my current report and directly below shows what I'm hoping to receive when filtered by Home Group.

Salvetti_01_0-1737388203180.png

Actual_Payroll table

Salvetti_01_1-1737388326044.png

 

Groups Table

Salvetti_01_2-1737388398412.png

 

Data Model - Groups(Group) - Actual_Payroll(Group)

Salvetti_01_3-1737388601712.png

 

PD_Fund table (not part of data model)

Salvetti_01_4-1737388879113.png

 

PD_HCC (not part of data model)

Salvetti_01_5-1737388929382.png

 

Hi,

I have solved a similar problem in the attached file.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks Ashish. Disconnecting the tables was helpful. In addition, some DAX was needed.

Earning Amount =
VAR SelectedGroup = SELECTEDVALUE(Groups[Group])
VAR SelectedCostCenter = LOOKUPVALUE(Groups[Group Cost Center],Groups[Group], SelectedGroup)

RETURN
CALCULATE(
    SUM('Actual_Payroll'[Earnings Amount]),
    FILTER(
        Actual_Payroll,
        Actual_Payroll[Charged Cost Center] = SelectedCostCenter
        || Actual_Payroll[Home Cost Center] = SelectedCostCenter
    )
)
Ashish_Mathur
Super User
Super User

Hi,

Access Denied message.  In that PBi file, cclearly show the problem and the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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