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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Need help with working out Cumulative Target Hours across timeframe

Hi there,

 

I am currently working on a report which looks at timesheets of engineers. I have calculated the Cumulative CAPEX and Total hours by using the following DAX:

 

Cumulative Capex Hours =
CALCULATE (
[Total Capex Hours],
FILTER (
ALLSELECTED ( 'Calendar'[Date].[Date] ),
'Calendar'[Date].[Date] <= MAX ( 'Calendar'[Date].[Date] )
)
)
 
Cumulative Working Hours =
CALCULATE (
[Jira Logged Hours],
FILTER (
ALLSELECTED ( 'Calendar'[Date].[Date] ),
'Calendar'[Date].[Date] <= MAX ( 'Calendar'[Date].[Date] )
)
)
 
I am now trying to work out the Cumulative Target hours by using:
Cumulative Target Hours =
VAR NoEmp =
DISTINCTCOUNT( TeamsandRoles[Developer Name] )
VAR Target =
CALCULATE (
[Target Hours Per Day],
FILTER (
ALLSELECTED ( 'Calendar'[Date].[Date] ),
'Calendar'[Date].[Date] <= MAX ( 'Calendar'[Date].[Date] )
)
)
RETURN
NoEmp * Target
 
But it doesn't seem to work - I keep getting the following (all of the engineers hours are the same):
olivia-ronan555_0-1619603179138.png

What is the best way to ensure that there are distinct Cumulative Target hours for the engineers?

 

I look forward to hearing from you guys!

 

Cheers 🙂

3 REPLIES 3
v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

Has your question solved? If solved ,you could share your solution then mark it .If not ,could you pls share your pbix file ? Remember to remove confident data.

 

Best Regards

Luicien

amitchandak
Super User
Super User

@Anonymous , Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

Try like

 

Cumulative Target Hours =
VAR NoEmp =
DISTINCTCOUNT( TeamsandRoles[Developer Name] )
VAR Target =
CALCULATE (
[Target Hours Per Day],
FILTER (
ALLSELECTED ( 'Calendar'[Date].[Date] ),
'Calendar'[Date].[Date] <= MAX ( 'Calendar'[Date].[Date] )
), filter(allselected(TeamsandRoles[Developer Name] ), TeamsandRoles[Developer Name] =max(TeamsandRoles[Developer Name] ))
)
RETURN
NoEmp * Target

 

 

 

or

 

 

Cumulative Target Hours =
VAR NoEmp =
DISTINCTCOUNT( TeamsandRoles[Developer Name] )
VAR Target =
CALCULATE (
[Target Hours Per Day],
FILTER (
ALLSELECTED ( 'Calendar'[Date].[Date] ),
'Calendar'[Date].[Date] <= MAX ( 'Calendar'[Date].[Date] )
), filter(allselected(TeamsandRoles[Developer Name] ), TeamsandRoles[Developer Name] =max(TeamsandRoles[Developer Name] ))
)
RETURN
 Target

Anonymous
Not applicable

Hi Amit,

I have screenshotted the following and blocked out sensitive data (i.e. names):

olivia-ronan555_0-1619607900560.png

I think an issue might be the measure for target hours, which is the following:

Target Hours Per Day = COUNTROWS( 'Calendar') * 4.44
 
I look forward to hearing from you!
 
Cheers 🙂

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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