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

Colleague capacity and forecast in two different queries

Hello guys,

I faced a problem while building new report. I have two queries - in one I have stored colleagues forecasts for different months of the year (specificaly for only one category - PTO) and in the other I am having their (weekly/daily/monthly) capacity. What I am trying to get is a count of how many days off they are taking each month based on their individual capacity - i.e.:

 

"If colleague's weekly capacity is 40 hrs and he is taking 16 hrs off in June I want it to show -> "2 days" in column June, and if other one is having 37.5 hrs weekly capacity and took 15 hrs off -> also "2 days" off".

 

I was trying to create DAX vlookup column in Forecasting query which is taking the capacity from Colleagues query:

"ColleagueDailyCapacity = LOOKUPVALUE(Colleagues[Daily_Capacity], Colleagues[ColleagueID], Forecast[Colleague_ID)"

to be able to create measure based on that in one query (something like "DaysOff = Forecast[June_2019]/Colleagues[Daily_Capacity]"), but it throws me blank rows...

 

My forecast table looks like that (all month columns are coming from query and rest from the other):

 

forecast.jpg

 

What could be the proper way to do it?

Thanks in advance for all help!

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

Hi @Anonymous ,

 

To create relationship between tables and use RELATED function should work. Could you please share your sample data of your both tables to me so that I can have a test, f you don't have any confidential Information. Please upload your files to One Drive and share the link here.

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

To create relationship between tables and use RELATED function should work. Could you please share your sample data of your both tables to me so that I can have a test, f you don't have any confidential Information. Please upload your files to One Drive and share the link here.

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

Hello @v-frfei-msft ,

 

Yes, that's it! I totally forgot about existance of "related" function - it is really useful.


Case solved - thank you!

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.