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

Be 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

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
v-tangjie-msft
Community Support
Community Support

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
v-tangjie-msft
Community Support
Community Support

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
Most Valuable Professional
Most Valuable Professional

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 

AmiraBedh
Most Valuable Professional
Most Valuable Professional

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.