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
Saranya_Tamil
Frequent Visitor

Need help in DAX

Hi,
I have 2 tables. Table A shows the number of hours eligible to work and Table B shows how many hours they actually worked. I need to calculate Time% i.e.  (hours/Time)*100 for each resource for everyday as output. I have many resources in the table.  Can anyone help to achieve this in DAX. I have highlighted the expected output column.

 

Table A    Table B   
ResourceDateTime  ResourceDatehoursOutput
A01/01/20227.5  A01/01/20227.5100
A02/01/20227.5  A02/01/2022453.33333
A03/01/20227.5  A03/01/20223.546.66667
A04/01/20227.5  A04/01/2022793.33333
A05/01/20227.5  A05/01/20227.5100
A06/01/20227.5  A06/01/20227.5100
B07/01/20227.5  B07/01/2022680
B08/01/20227.5  B08/01/20227.5100
B09/01/20227.5  B09/01/20227.5100
B10/01/20227.5  B10/01/20227.5100
1 ACCEPTED SOLUTION
Arul
Super User
Super User

Hi @Saranya_Tamil ,

You can try the below formula in calculated column,

 

 

Output Column = 
VAR _lookupvalue = LOOKUPVALUE('Table A'[Time],'Table A'[Resource],'Table B'[Resource])
VAR _output = DIVIDE('Table B'[hours],_lookupvalue,0)*100
RETURN _output

 

Arul_1-1669636624759.png

 

Thanks,

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


View solution in original post

1 REPLY 1
Arul
Super User
Super User

Hi @Saranya_Tamil ,

You can try the below formula in calculated column,

 

 

Output Column = 
VAR _lookupvalue = LOOKUPVALUE('Table A'[Time],'Table A'[Resource],'Table B'[Resource])
VAR _output = DIVIDE('Table B'[hours],_lookupvalue,0)*100
RETURN _output

 

Arul_1-1669636624759.png

 

Thanks,

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


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.