Saaru Lindestøkke
Saaru Lindestøkke

Reputation: 2544

How do I create a single bar chart from three independent data sources?

Input

I have three datasets (simplified example below):

Every dataset has two columns: studentId and age.

Desired result

I want to create a bar chart that shows the distribution of age across these schools. For easy comparison I would like to have:

What I have tried

I tried linking the datasets, but due to the different number of students and the various studentId formats per school this did not work.

I tried using the studentId columns of the three datasets as the value and the age column of every dataset as the axis. This only worked one dataset at a time. I needed to "Go to the next level in the hierarchy" to see the other dataset.

How else can I achieve this?

Upvotes: 1

Views: 105

Answers (1)

kiewic
kiewic

Reputation: 16420

You can go into Power Query Editor:

Power BI edit queries

And you will need to add a new column for each datasheet with the legend you want, for example:

Power BI add custom column

So your tables should look like this:

Power BI query

Power BI query

Then merge the tables with Append Queries as New:

Power BI Append Queries as New

Select Three or more tables, and add the three tables:

Power BI Three or more tables

And there you have your three tables merged into one.

Power BI - Power Query Editor

Power BI Stacked Column Chart

Upvotes: 2

Related Questions