Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Airwen
Frequent Visitor

Merge tables for a weather forecast

Hi,

I'm working on a project to create a weather forecast based on 3 variables: temperature, cloud cover, type of rainfall.
I received external help to extract the weather data and apply it to the historical data based on the city name -> "Historique" table (Ville).
There is then a "Prévisionnel" table which extracts the weather for the next 15 days from visualcrossing and arranges it by date, week and town name.
Would it be possible to merge these two tables and get the sales quantity (QuantiteTotalHebdo) per "Code Client" and "Reference Article"?
The table would run over the two weeks of the weather forecast with an average of the quantity sold in the "historique" table.
To search the quantity, I thought of selecting for each criterion with a margin of 20%. For example, the average temperature is 20°C in week number 15. We search for each year and the customer quantity sold in the same week. If the temperature is the same +/- 20%, we take it. If the conditions are met over 3 years, it would be an average of the quantity. Same goes for cloud cover and rain type.
The summary table would look like this:

DateSemainePrevisionsVilleréférence articlecode clienttemp_moyenne (°C)couverture_nuageuse (%)type_precipitationQte tempQte couvQte type
26-août-2435BRUGUIERES1005G10721,783rain507
26-août-2435CHAVANOD915T59517,675rain436

I first tried to do this with the DAX, but it didn't seem practical.
With this table, it's possible to create a chart of the predicted sales on the filtered variable.
Bellow the link to the pbix file :
link
Many thanks

5 REPLIES 5
lbendlin
Super User
Super User

What benefits are you expecting from merging the tables?  Is that something that could be done better in the data model.

Hi @lbendlin 
Merging would help to link side tables such as a customer base and an item base and then show the result from different angles. Someone helped build the data model, but we can't work together. My knowledge of Python is too short to rebuild the model. The aim was to use the existing data.
Kind regards

I would recommend to spend some time learning how to create and manage data models.

This project is linked to a larger project where the data model is already established and running. It was an opportunity to extend the existing model by adding a weather forecast table.

The only solution would be to create a different modele using python ?

You don't create models using Python.  With Python you can prepare tabular data (like your forecast) that can then be added  (joined/linked) to the existing data model. 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.