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
AshDil
Helper V
Helper V

Comparison of Workhours and Manhours based on joining date

Hi,

I have data as follow:

Person NameJoining DateMan hours
A1/10/20211275
B23/03/2021950
C12/4/2021700
D5/5/2021250

In every week of 5 days, total workhours are 45.

I have a date slicer showing range of dates,I calculated no.of weeks in that duration and multiplied with 45 (Workhours of a week), Now I want to show comparison between total workhours and manhours in that duration. If a person joined in middle of selected duration then I want to show comparison only from his/her joining date and all previous values must be blank.

 

Please help me to do.

 

Thanks,

AshDil.

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @AshDil ,

 

Try the following formula:

 

Measure = 
DATEDIFF(
    MINX( {MIN('Date'[Date])}, {MIN('Table'[Joining Date])} ),
    MAXX( {MAX('Table'[Joining Date])}, {MAX('Date'[Date])} ),
    DAY
) / 7 * 45

 image.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-kkf-msft
Community Support
Community Support

Hi @AshDil ,

 

Try the following formula:

 

Measure = 
DATEDIFF(
    MINX( {MIN('Date'[Date])}, {MIN('Table'[Joining Date])} ),
    MAXX( {MAX('Table'[Joining Date])}, {MAX('Date'[Date])} ),
    DAY
) / 7 * 45

 image.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@AshDil , A measure can help in total hours in selected range

 

measure =
VAR _max = MAXX(allselected("Date"),"Date" [Date])
var _min = MinX(allselected("Date"),"Date" [Date])
return

datediff(_min, _max,day)/7 *45  // or //datediff(_min, _max,week)45

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.