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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
sthomas2010
Frequent Visitor

Help Creating a Measure that calculates off of a specific date range

I am a novice when it comes to PowerBI but over the past 2 years, I have been able to create measures that allows me to take employee time on a job and multiply by their rate so I can see how much billable time people are putting to a job and then determine if a job was profitable or not (by connecting my Quickbooks database and importing the different data points). 

 

But my problem is that each of my billable hour measures takes into account all-time on my TimeTracking table (which has data from 2019-today).   I also have jobs that have different "JobType" based on the service we perform.   I currently use slicers to filter based on a single year but I am wanting to be able to see how a particular job type is looking over the course of the past 2.5 years but that includes 2-3 different billing rates used for the employee's hours worked between 2021 and 2022.  Each year has a different billing rate.

 

Currently, I use the following measures to help calculate the billable time when I am looking at a single job for one year:

Employee Hours = sum(TimeTracking[Hours])

2021 Billing Rate = SUM('Service Items Merged'[2021 Service Price])
2021 Billable Hours = SUMX('Service Items Merged', 'Service Items Merged'[2021 Billing Rate] * [Employee Hours])

 

Basically, I am trying to get billable hours for a particular job to = (Employee Hours from{1/2020-12/31/2020} are multiplied by the [2020 Billing Rate]) + (Employee Hours from{1/2021-12/31/2021} are multiplied by the [2021 Billing Rate]) + (Employee Hours from{1/2022-12/31/2022} are multiplied by the [2022 Billing Rate]) 

 

This way I can look at each job over the course of a few years and compare them to others in the same JobType and then determine if that JobType is even profitable or should we stop doing that work.

 

Is this possible?

2 REPLIES 2
vapid128
Solution Specialist
Solution Specialist

Can I see your file? 

Or how is your table looks like.

 

 

So I can not provide my file due to sensative account information:  But here are screenshots of the TimeTracking table and then also an example of my visual I am trying to work with.

sthomas2010_0-1656598372546.png

TimeTracking has job, Employee(ServiceItem), date and hours spent.

 

ServiceItem Merged Table has columns for each service hour rate per the service item.

sthomas2010_2-1656598940942.png

 

My current visual looks like this:

sthomas2010_1-1656598659783.png

But it is calculating the billable time all under one rate (in the top left visual) when those jobs actually have different rates.  The bottom visual is showing the multiple rates but the employee time is the total time for 2020-2022 when I really need the billable rate to be calculated so 2020 hours are calculated at the 2020 rate, 2021 hours are calculated at the 2021 rate, and 2022 hours calculated at 2022 rates.

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.