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

Create a measure from columns in different tables

Hello, 

I have two tables related to each other. One has recorded employee time, broken down by time type and the other planned time (planeed time is daily not dependent on time type)

 

I want to create a measure with % of recorded time/planned time. I cna do this at total level however, I am not able to make it work in a chart where the employee name is in the axis and time type in the labels. 

 

Could someone suggest a solution?

 

Recordings Table    Planned Time Table  
DateEmployee CodeTime TypeRecorded Time DateEmployee CodePlanned Time
01/01/20213445a4  01/01/202134458 
01/01/20213445v5  02/01/202134458 
02/01/20213445d2  01/01/202145567 
01/01/20214556d4  02/01/202145567 
01/01/20214566q2  01/01/202122225 
02/01/20214566c4  02/01/202122225 
01/01/20212222a4      
01/01/20212222d1      
02/01/20212222q3      
1 ACCEPTED SOLUTION

Hi, @almaarapi 

I am not quite sure whether I follow your point.

If you want to divide by the sum of planned time, please check the below if it suits your requirement.

 

Picture1.png

 

https://www.dropbox.com/s/eureyhe950g5rbr/almaarapi.pbix?dl=0 

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

7 REPLIES 7
almaarapi
Frequent Visitor

Hi Jihwan, 

I made up the data just for the sake of showing what I was trying ot achieve. The data I have go back in time for months so I need to be able to slice them properly. The formula you sent were well for the total timeframe but once I put slicer on the report the filtering did not work correctly as it filters the recording time but the planned time remains the total. A better example would be below. 

Thanks

Recordings Table    Planned Time Table  
DateEmployee CodeTime TypeRecorded Time DateEmployee CodePlanned Time
01/01/20213445a4  01/01/202134458 
01/01/20213445v5  02/01/202134458 
02/01/20213445d2  01/01/202145567 
01/01/20214556d4  02/01/202145567 
01/01/20214566q2  01/01/202122225 
02/01/20214566c4  02/01/202122225 
01/01/20212222a4  01/03/202134458 
01/01/20212222d1  02/03/202134458 
02/01/20212222q3  01/03/202145567 
01/03/20213445a2  02/03/202145567 
01/03/20213445v4  01/03/202122225 
02/03/20213445d7  02/03/202122225 
01/03/20214556d3      
01/03/20214566q4      
02/03/20214566c5      
01/03/20212222a7      
01/03/20212222d1      
02/03/20212222q3      
          

 

 

Hi,

Thank you for your feedback.

 

I don't know about your data model, but I think you can connect the two tables.

 

As you have seen in my sample pbix file, there was no connection between the two tables.

 

Thank you.

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


almaarapi
Frequent Visitor

Hi Juhwan, 

That is what I was looking for but I cannot make it work with time Slicers. It works on totals but if I set a slicer for Month 3 or Week 12 the % calculated is still towards total planned not total in the selected timeframe. 

 

Thanks

Hi,

Thank you for your feedback, but I do not understand setting a slicer for Month3. Because I could not find it in your sample.

I assume you have a different sample.

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Jihwan_Kim
Super User
Super User

Hi, @almaarapi 

 

Please correct me if I wrongly understood your question.

I am not sure about how you want to describe the result. Please check the below picture and the sample pbix file's link down below, whether it is what you are looking for.

DAX measure is in the sample pbix file.

 

Picture1.png

 

https://www.dropbox.com/s/eureyhe950g5rbr/almaarapi.pbix?dl=0 

 

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Hi Jihwan, 

thanks. The problem with this is that is doing the calcualtion on specifc date. e.g. employee code 2222, time type q is 60% in the chart as 3/5. I need it to be 30% as (Summ of recorded time)/ (Sum of planned time), and use slicer for the filters. 

I will try to play with this a bit and see if I can adapt it. 

Thanks

Hi, @almaarapi 

I am not quite sure whether I follow your point.

If you want to divide by the sum of planned time, please check the below if it suits your requirement.

 

Picture1.png

 

https://www.dropbox.com/s/eureyhe950g5rbr/almaarapi.pbix?dl=0 

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


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.

Top Solution Authors