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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Community Champion
Community Champion

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
Community Champion
Community Champion

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.