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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
datalalor
New Member

Power BI - Grouping and Running Calculation based on a date filter.

I need some help with grouping data and running calculations with date filters. Here is the original data, and I would like to add some of the calculation of the gross pay (Reg Pay+Bonus Pay), total hours (Reg Hours+OT Hours), and Actual Hourly Rate (gross pay / total hours).

First NameCheck Date Reg Pay Bonus Pay Reg HourOT Hours
A12/1/2023175 21
A12/7/202322550031
A12/14/2023175 21
B12/1/2023175 21
B12/7/202327510041
B12/14/2023375 51

 

What I need is, if I set the date range from 12/1/2023 to 12/14/2023, it will group first name, sum Reg Pay, Bonus Pay, Reg Hour, and OT Hours, then do the calculation of gross pay and total hours, then run the calculation for the actual hourly rate.

I added Gross Pay, Total Hours and Actual Hourly Rate as a new column, please see below.

 

Gross Pay = Payroll_Journal[Reg Pay]+Payroll_Journal[OT Pay]
Total Hours = Payroll_Journal[Reg Hours]+Payroll_Journal[OT Hours]
Actual Hourly Rate = IFERROR(Payroll_Journal[Gross Pay]/Payroll_Journal[Total Hours],0)

 

However, this is my return result, which is returning the sum from each paycheck's actual hourly rate.


First Name Reg Pay Bonus Pay Reg HourOT HoursGross PayTotal HoursActual Hourly Rate
A57550073107510297.92
B82510011372514162.5

 

I am hoping to get the following result, is it possible?


First Name Reg Pay Bonus Pay Reg HourOT HoursGross PayTotal HoursActual Hourly Rate
A57550073107510107.50
B8251001137251451.79
1 ACCEPTED SOLUTION
datalalor
New Member

This solved! Turns out I need to set the Actual Hourly Rate calculation as a measurement instead of a column. 🙂

View solution in original post

1 REPLY 1
datalalor
New Member

This solved! Turns out I need to set the Actual Hourly Rate calculation as a measurement instead of a column. 🙂

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors