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.
So the current situation (though I could imagine this will come up a lot) is that I want to get a table of weather patterns for a location. I have 3 tables:
I want to make these into one table that will be called _combined_weather with the columns Year, Month, Day, max_temp, min_temp and rainfall.
This should be done as an outer join, as not all days have data. So I would do:
The issue with this, is that if a day is missed on max_temp and not min_temp or rainfall, it will create 2 rows.
How can you get around this?
Solved! Go to Solution.
Hi @Anonymous ,
There is a new solution. Please download the demo from the attachment.
1. Append all the tables as a new table.
2. Group by the table by Year, Month, Day. Please refer to the snapshot below.
Best Regards,
Hi @Anonymous,
There is a solution. But firstly I would say we usually create relationship among these tables in your scenario. Especially the data size is large.
The solution is as follows.
1. Create a new table which contains all the Year, Month, Day, which is continuous.
2. Meger all other three tables to this new table using Left Outer Join.
3. Expand only the desired column.
4. Remove the columns that have nothing in all the three columns.
Please refer to the snapshot below.
Best Regards,
Hi @Anonymous ,
There is a new solution. Please download the demo from the attachment.
1. Append all the tables as a new table.
2. Group by the table by Year, Month, Day. Please refer to the snapshot below.
Best Regards,
This is the correct solution and the logic behind it is good. Thanks for that.
But we need to create the dates from the other 3 tables, thats the point. So you would start with a blank table with year month day. You can't do a left outer join, otherwise there is nothing to join onto. If you do a right outer join, it keeps the value on the left, so you get the correct number of rows, but the year month and day fields are all null as they weren't on the left, we want to join them in on the left (get the values from the right and insert them on the left table).
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |