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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
huguestremblay
Helper II
Helper II

Help need with a measure and totals

Hello,

I have a report where I calculate work productivity based on the number of hours worked by each employees of a group compared to their individual targets.  The date at which the employee joined the group should be taken into account when doing the overall calculations but I cannot get it to work.  I tried creating a Measure that include the Start Date (from the PS table) but without success.

I have created a simplified version of my situation here as I cannot share my original report. The 2 tables are linked by the Name columns.

huguestremblay_0-1655404313115.png

The table shows the target number of hours for each employee, and has blank values for employees that did not work in a given month (e.g. Eddie joined in April and Chloe in May).  It works on the individual rows, but the Total includes all employees, even for the month where they were not in the group yet.

 

What I would need is the total to be 407.4 for March, 575.4 for April and 743.4 for May...

 

I later use that value in another calculation along with the actual number of hours worked to get the productivity.  Right now, everything works as expected if I select an individual employee, but as soon as I have more than one, or the entire team, the productivity is underestimated because it uses the target total as if all employees had been in the group forever.

 

My simplified report is available here.

 

Any help in getting this to work would be realloy appreciated!

 

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @huguestremblay 
Please use the following measure

Target Hours = 
CALCULATE ( 
    SUM ( PS[Target Hrs/Mo] ),
    CROSSFILTER ( PS[Name], Entry[Name], BOTH )
)

1.png

View solution in original post

3 REPLIES 3
tamerj1
Super User
Super User

Hi @huguestremblay 
Please use the following measure

Target Hours = 
CALCULATE ( 
    SUM ( PS[Target Hrs/Mo] ),
    CROSSFILTER ( PS[Name], Entry[Name], BOTH )
)

1.png

HotChilli
Super User
Super User

I suppose a simple solution would be to merge the Target Hrs column into the Entry table in power query. 

-

I know it's a simplified model but the problem is that with PS table filtering Entry the relationship, the dates can't retrieve accurate data from the PS table (it's a bit of an anomaly that the hours targets -apart from the total - are correct in the matrix because there is only one hours value for each name)

--

Alternatives are, I think, generating Target HRs for each month in the PS table and using a Name dimension table to filter PS and Entry.  Haven't tested this but you can see that the merge in my first suggestion effectively does this in a simpler way.

Thank you for the suggestions, I will give that a try.

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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