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
Svenvdh
Regular Visitor

Combine 2 tables with empty cells

The problem below occurs:
We have 2 database files. The first contains the number of hours per file number at activity level. In the second file you have the revenue amount per file number at activity level.
We want an overview of the number of hours spent and revenue made per file number per activity. But the activities do not have the same names and not every activity can be used for both the hours file and the turnover file.

Simplified example         
         
Database for the hours    Database for the revenue 
ActivityFile numberWorked ours  ActivityFile numberRevenue 
AAC12340,250  XYB1234 €  150,00 
AAD12340,125  XYD1235 €  200,00 
AAA12350,500  XYZ1236 €    25,00 
AAA12361,000  XYZ1236 €    75,00 
AAB12360,250  XYA1237 €  125,00 
AAC12360,125  XYD1237 €  175,00 
AAD12360,500  XYC1237 €    50,00 
AAC12371,000  XYB1238 €    25,00 
AAD12370,250  XYA1238 €  100,00 
         
So some activities are linked and others not. Like in the example below    
Linking table        
Activity hoursActivity revenue       
AAAXYZ       
AABXYA       
AAC        
 XYD       
AADXYC       
 XYB       
         
Now we want to see when the file number are the same if there are hours against the made revenue. 
File numberActivity revenueActivity hoursamountours    
1234XYZAAA €    50,000,500    
 XYAAAB €  100,001,000    
 XYB  €  150,000,000    
  AAC €           -  0,250    
  AAD €           -  0,125    
1235XYD  €  200,000,000    
1236XYZ AAA  €  100,001,000    
  AAB €           -  0,250    
  AAC €           -  0,125    
  AAD €           -  0,500    
1237XYA  €  125,000,000    
 XYD  €  175,000,000    
 XYCAAD €    50,000,250    
  AAC €           -  1,000    
1238XYB  €    25,000,000    
 XYA  €  100,000,000    
1 REPLY 1
v-robertq-msft
Community Support
Community Support

Hi, @Svenvdh 

According to your description and sample data, I can’t clearly understand what you want to get. Would you like to explain the columns in your expected output in detail(using some examples to explain why they are here and why their value is like this)?

v-robertq-msft_0-1617609447785.png

 

Thanks very much!

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

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

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.