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
KCinMelbourne
Resolver I
Resolver I

Joining 2 x Tables with Inconsistent Data

Hi guys, 

 

Would appreciate your advice on on combining results into a visual that is sourced from 2 tables with different fields.

 

Goal

Reporting a full year resource count where the source of the data is 

  • Year to Date: Actual Full Time Equivalent (FTE) Table
  • Rest of Year: Forecast Full Time Equivalent (FTE) Table

 

The outcome should look as follows assuming Jan-May is actuals and Jun - Dec is Forecast:
Error - Table with Blank.PNG

 

 

Problem

There are fields available in Forecast that are unique to that dataset and not found in the Actual table.  For example, "Submitted By" would indicate who submitted the forecast, but would not be relevant for actuals.  Resource Name on the otherhand is linked by a Master Table.

 

The current result is as follows

 Error - Table with no Blank.PNG

 

Desired Solution

I can overcome this by creating a dummy 'Submission By' field in the Actuals table and a relationship between the two but this adds added complexity to the model and generates calculated columns increasing the memory usage unnecessarily. It may seem acceptable for one field but we may have many inconsistent fields.  I was hoping to understand how I can resolve this in the measure so that the 0.6 FTE from actuals only shows against a blank line.

 

Thanks

KC

8 REPLIES 8
v-frfei-msft
Community Support
Community Support

Hi @KCinMelbourne,

 

I made one sampe for your reference.

 

1. Enter the data and append the actual and forcast table in power query.

 

2. Create a calculated column in the append table.

 

Column = SWITCH(Append1[Period],"Jun",6,"Jul",7,"Jan",1,"Feb",2,"Mar",3,"Apr",4,"May",5,"Aug",8,"Sep",9,"Oct",10,"Nov",11,"Dec",12)

re1.PNGre2.PNG

For more details, please check the pbix as attached.

 

https://www.dropbox.com/s/ao7kyqeyfi2zoi5/join.pbix?dl=0

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Thanks @v-frfei-msft for your feedback. 

I recognise the consolidation of the tables is an option but given this is part of a fully operating model, it will require some extensive effort to change and risk of dissruption to my stakeholders. 

For this reason, and also for my personal development, I was really seeking to understand specifically whether it is possible to 'ignore' the unrelated fields and return the value against 'blank' using a measure.

 

Cheers

Kirsty

Stachu
Community Champion
Community Champion

can you share how the input tables look like? 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Hi @Stachu

 

Thanks for your message.


Following is a screenshot of the tables that would match the output tables above.  I've also attached an excel file in case that is easier to work with. 

 

Example Tables.png

 

Cheers

KC

I had to create Submitted table with joins to Submitted in Forecast and inactive join to ReferenceID

Measure = 
CALCULATE(
    SUM(Fact_Actuals[FTE]),
    USERELATIONSHIP(Submitted[Submitted By],Fact_Actuals[Resource ID])
)
+ SUM(Fact_Forecast[FTE])


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Thanks @Stachu,

It certainly sounds likea  reasonable option.  Given I might have numerous columns though with data such as [Submitted By] I was hoping to find a solution which didn't involve a requirement to generate a 'Submitted' table as suggested.

 

I'm concerned that the creation of new fields would require extensive maintenance.  

 

I expect I may need to merge the two tables but it is a big task given the number of measures that are already written over this data so its a last resort.

 

Thanks for your feedback so far.

apart of complexity of having more tables the maintenance is actually no effort - I referenced the Forecast table, removed all other columns, and then removed duplicates
so basically whenever forecast table is updated Submitted will be as well

I must say I don't like this solution either, but I couldn't figure out anything better

the easiest thing to do is just append the 2 tables as one, while also adding Actuals/Forecast flag column to respective tables
M will manage the inconsistent columns by itself, like in this code

let
    Source = Table.Combine({Table.AddColumn(Fact_Forecast, "Type", each "Forecast"), Table.AddColumn(Fact_Actuals, "Type", each "Actuals")})
in
    Source


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Thanks @Stachu,

I can certainly follow your solution as I mentioned it is my fallback option.  I am trying to understand however for my own personal development if there is a simple DAX measure solution that doesn't involve consolidating the table/creating master tables.  So I might leave my query open to see if any others have feedback.

 

Thanks for taking the time to investigate and respond!

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.