Forum Discussion
AlexDawson1111
3 years agoNew Member
Calculate Hours Per Week
Hi, I am looking for the best way to calculate hours required per week by week end date. The scenario is as follows:- 1) I have a Task Number, Task Start Date and a Task End Date. The task ha...
amitchandak
3 years agoSuper User
AlexDawson1111 , a new table (Assumed you have column like task amount and task id)
var _Tab =
filter(
Addcolumns(generate(Task, calendar([Start Date], [End Date]) ), "Week end", [Date]+ 7-1*WEEKDAY([Date],2) -1), [End Date] =[Date])
return
Addcolumns(_tab, "Amount", [Task Amount]/ countx(filter(_tab, [Task id] = earlier([Task id])),[Task id]) )
AlexDawson1111
3 years agoNew Member
Hi,
Thanks for your assistance.
Here is a data example:-
Fact_Table Data containing the Start Date and End Date and Hours
Fact_Table
dim_Calender - This contains the date and calender ID, each task has a related calender as each task has different working days and hours etc
dim_Calendar
model:-
data model