Forum Discussion

angelsmilexd's avatar
angelsmilexd
New Member
3 years ago
Solved

Creating a line and clustered column chart with 2 different data sources that cannot be merged

Hi, I'm still new to Power BI and am trying to start my own data visualization project.    I have 2 data sources - one on the general resident population of my country and one on the flat (HDB) res...
  • TomasAndersson's avatar
    3 years ago

    Hi!

    Great that you shared an example file!

    Your model needs a shared year column so that the different data sets "get" that the years that they refer to are the same. So when you use the year column from one table it works with that table, but it does not "talk" with the year column in the other table (instead just returning blanks).

    One good practice is to have a common date table, that you create relationships to and then use as the dimension in visuals: https://www.datacamp.com/tutorial/how-to-create-date-tables-in-power-bi-tutorial 


    I modified your model by adding a date table (although only with years for simplicities sake) that I created relationships to your other two fact tables with. (I also removed the "combined" table as it should not be needed with the right relationships in a model):


    Then I modified your clustered column visual only by replacing the x-axis to using the Year column from the date table instead, and got the following:


    Maybe this looks more like what you expected.

     

    Hope this helps!