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.
Hi all,
I have been reading all posts, watching all videos I came across (there are a lot!) on this topic. Thank you all. It is a great content and have learned a lot!
I do have a datset containing:
Employee, project number, start, end date, hoursEstimate
I also have a calendar table, no relationship to data table and have a holiday table with date column
I have a matrix visual, my columns are year,month,day
Rows are employee,project.
Following this great post How to divide/distribute values between start date... - Microsoft Power BI Community
I'm able to allocate the value across the start and end date
The DAX is:
Value by day of Month = CALCULATE(SUMX(SUMMARIZE(FILTER(CROSSJOIN(' Workload','Date'),'Date'[Date]>='Workload'[StartDate]
&& 'Date'[Date]<='Workload'[Due date]),' Workload'[ID.1], 'Date'[Date],' Workload'[HoursEstimate],'Workload'[StartDate],' Workload'[Due date]),
DIVIDE('Workload'[HoursEstimate],DATEDIFF('Workload'[StartDate],'Workload'[Due Date],day)+1)))
Since I need to exclude weekends and holidays, I've created a workday column that shows 1 for weekdays, 0 for saturday and sunday.
I have created a holiday table with a date column.
I then, attempted to modify the above DAX, also try creating separate measures but I'm not having any luck!
I would appreciate if someone can help me either modifying the dax measure above, or suggesting me a different way to allocate hoursestimate evenly between start and end date excluding weekends and holidays.
I will be very grateful!
Hi @omelo ,
The created formulas don't seem to have much of a problem. What does your data model look like and are there filtering issues due to table relationships.
Looking forward to your feedback.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @amitchandak , as I mentioned, I do have a "workday" column that gives me 0 for saturday and Sunday and 1 for weekday. I'll deal with the holidays later>
I've tried modifyng the dax but I'm overcomplicating the expresion and don't get the expected results, could you please help me with this expression.
@omelo , Have date calendar with holiday day .
Then you can follow the approach given with calendar to get business date, How to calculate Business Days/ Workdays, with or without date table: https://youtu.be/Qv4wT8_P-AA
In divide
Crossjoin approach seems fine. You can use generate in place of crossjoin
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |