March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi!
-I'm calculating Capacity% of a resource, based on 5 day week (including holidays) vs 7 day week * Resource Hrs/day.
I'm using a calendar table and calculated column for workday:
Solved! Go to Solution.
Hi,
Please take following steps:
1)Create two columns in Calendar and Query1 tables:
Year&Month = FORMAT('Calendar'[Date],"YYYY-MM")
Year&Month = FORMAT('Query1'[StartingDate],"YYYY-MM")
2)Try to create this column in Calendar table:
WorkDays per Month =
CALCULATE (
COUNT ( Calendar[Workday] ),
FILTER (
ALLSELECTED ( 'Calendar' ),
'Calendar'[YearMonthnumber] = EARLIER ( 'Calendar'[YearMonthnumber] )
&& Calendar[Workday] = 1
)
)
3)Try to create this column in Query1 table:
WorkDays per Month = RELATED('Calendar'[WorkDays per Month])
4)Try this column to show the 5days% expected result:
5days% = DIVIDE ( (Query1[SUM(LOAD1)]), (RELATED (Resource[Hrs/Day]) * Query1[WorkDays per Month]),0 )
5)The result shows:
Here is the changed pbix file:
Hope this helps.
Best Regards,
Giotto
Hi,
Could you please create and share some simple sample and expected result as screenshots with me?
And it can let me help you further and more efficiently.
Remember removing any sensitive data.
Expect your reply!
Best Regards,
Giotto
Hi,
Thanks everyone for the posts, unfortunately it hasn't helped. below is a recreated sample of my file in its original state, before the various modifications suggested above and without private data sources.
https://www.dropbox.com/s/e7nbm1fjjb2q2sj/ResCapactiySample.pbix?dl=0
The 5day% calculation is the problem, Expected result sample as follows:
5days% for Res5 on October 2020 =
Hi,
Please take following steps:
1)Create two columns in Calendar and Query1 tables:
Year&Month = FORMAT('Calendar'[Date],"YYYY-MM")
Year&Month = FORMAT('Query1'[StartingDate],"YYYY-MM")
2)Try to create this column in Calendar table:
WorkDays per Month =
CALCULATE (
COUNT ( Calendar[Workday] ),
FILTER (
ALLSELECTED ( 'Calendar' ),
'Calendar'[YearMonthnumber] = EARLIER ( 'Calendar'[YearMonthnumber] )
&& Calendar[Workday] = 1
)
)
3)Try to create this column in Query1 table:
WorkDays per Month = RELATED('Calendar'[WorkDays per Month])
4)Try this column to show the 5days% expected result:
5days% = DIVIDE ( (Query1[SUM(LOAD1)]), (RELATED (Resource[Hrs/Day]) * Query1[WorkDays per Month]),0 )
5)The result shows:
Here is the changed pbix file:
Hope this helps.
Best Regards,
Giotto
Perfect, Thankyou Giotto!!!
Hi,
Please try this measure:
5days% =
DIVIDE (
( Query1[SUM(LOAD1)] ),
(
RELATED ( Resource[Hrs/Day] )
* CALCULATE (
[Workdays],
FILTER (
ALLSELECTED ( Calender ),
Calender[Date].[Month] IN FILTERS ( Calender[Date].[Month] )
)
)
),
0
)
If you still have any issue, please share more info about your Resource table such as [Hrs/Day] data and these three tables relationships(including link columns) as screenshots. And these can let me help you further.
Expect your reply!
Best Regards,
Giotto
@kleighton change measure for workday in the divide function like this, it will give you workdays across the full month for each month
CALCULATE ( SUM ( 'Calendar'[Workday] ), ALLSELECTED ( 'Calendar'[Date] ) )
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Can you share sample data and sample output.
First, sample data. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Second, I generally have more luck with RELATEDTABLE vs. RELATED.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
133 | |
91 | |
88 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
73 | |
68 |