Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Miawto
New Member

Calucation between imported table and summarized & cross joined table

Hi, 

I need to calculate available hours pr. employee per team per month e.g. like this: 

Miawto_0-1725269563227.png

Table A: Imported table with project allocations pr. day pr. employee e.g.,

DateProjectInitialsHours
January 1st 2024AlphaABC8
January 1st 2024DeltaDEF8
Januart 2nd 2024BetaABC4

 

Table B: A summarize table with the employee capacity per month e.g., 

InitialsMonthSumCapacity
ABCJanuary143
ABCFebruary135
DEFJanuary154

I got help creating this table here, if you need details

 

I've tried with measurements and a similar new table as table B, but I'm not getting anywhere close to reality.

Do you have any suggestions? 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Miawto ,

 

Thanks AmiraBedh  for the quick reply. I have some other thoughts to add and am not sure if I have understood your needs correctly, if I have misunderstood please give the expected results and processing logic in a follow up reply.

 

(1)We can create two columns.

Month Column = FORMAT([Date],"mmmm")
Available hours = 
var _SumCapacity=CALCULATE(SUM('Table B'[SumCapacity]),FILTER('Table B',[Month]=EARLIER('Table A'[Month Column]) && 'Table B'[Initials]=EARLIER('Table A'[Initials])))
var _hour=CALCULATE(SUM('Table A'[Hours]),FILTER('Table A',[Date]<=EARLIER('Table A'[Date]) && [Initials]=EARLIER('Table A'[Initials])))
RETURN _SumCapacity-_hour

(2)Then the result is as follows.

vtangjiemsft_0-1725420774647.png

Best Regards,

Neeko Tang

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

5 REPLIES 5
Anonymous
Not applicable

Hi @Miawto ,

 

Thanks AmiraBedh  for the quick reply. I have some other thoughts to add and am not sure if I have understood your needs correctly, if I have misunderstood please give the expected results and processing logic in a follow up reply.

 

(1)We can create two columns.

Month Column = FORMAT([Date],"mmmm")
Available hours = 
var _SumCapacity=CALCULATE(SUM('Table B'[SumCapacity]),FILTER('Table B',[Month]=EARLIER('Table A'[Month Column]) && 'Table B'[Initials]=EARLIER('Table A'[Initials])))
var _hour=CALCULATE(SUM('Table A'[Hours]),FILTER('Table A',[Date]<=EARLIER('Table A'[Date]) && [Initials]=EARLIER('Table A'[Initials])))
RETURN _SumCapacity-_hour

(2)Then the result is as follows.

vtangjiemsft_0-1725420774647.png

Best Regards,

Neeko Tang

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

AmiraBedh
Super User
Super User

What do you want to achieve exactly?


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Hi @AmiraBedh 

I'd like to be able to visualize availability in a matrix like the first example I give in the text  where I describe what I need. 
If that doesn't answer your question then please let me know and I'll try to rephrase it 

Can you please provide clear input data ? is your Table B summarized in PBI or you are importing it like that?


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Hi @AmiraBedh 

Table B is summarized in PBI - I had help with this (see the solution here). It's summarized based on a date table and a imported table with employee data. 

Can't give the specific tables incl. datapoints 'cause it has personal data - that's why I've given examples of the data in my initial request and links to the solution. 

 

Hope this helps 🙂 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors