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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Timesheet data - visualise specific activity in each month

Hi,

 

I have a dataset of timesheet data, relevant columns are:

 

Entry Date - date of time entry e.g. 26 July 2018

Hours Worked- time spent on an activity - decimal hours

Task User Name - details of a specific actitvity e.g. Administration

MonthYear - custom column showing just hte Month and Year to help order things - August 2018

 

I need to show the time spent on a task (e.g. administration) as a percentage of the total time recorded in a single month.  I think I need to create an additonal column with the subtotal of hours for each month and then can use that to create the percentage in a further column but i cannot work out how to make the subtotal!

 

It also needs to be dynamic as am creating a template that I want to run each month without updating it...

 

Any help appreicated. 

 

Thanks,

 

James

 

5 REPLIES 5
v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

You may take a look at the following post.

https://community.powerbi.com/t5/Desktop/Subtotal-Percentages/m-p/313658#M139139

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
MFelix
Super User
Super User

Hi @Anonymous,

 

You need to create a measure to calculate this:

 

hours =
SUM ( Timesheet[Hours Worked] )
    / CALCULATE (
        SUM ( Timesheet[Hours Worked] );
        ALL ( Timesheet[Month Year]; Timesheet[Task User Name] )
    )

Without any data example is difficult to give you a better answer.

 

Chan you share some sample data and expected result?

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Capture1.PNG

I can get the subtotals in a visualisation easily - I just want to use these montly substotals in further calculations!

 

Is there a way to refer to this table or can i create this table dynamically in an expression so i can set up a robust template?

 

Thanks,

 

James

 

Anonymous
Not applicable

MonthHours = CALCULATE(SUM('January 2019 (rolling 6)'[Hours Worked]),RELATED('January 2019 (rolling 6)'[MonthYear]))
 
Trying to use this but there isn't a relationship...
 
James
 
Anonymous
Not applicable

Capture.PNG

 

Hi @MFelix

 

Thanks for replying.

 

Sample data attached. 

 

I don't understand how that measure will help me to find the monthly total for each month and then

allow me to use that in later calculations?

 

Thanks,

 

James

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.