web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Dataverse Views / SQL ...
Power Apps
Unanswered

Dataverse Views / SQL Joins

(0) ShareShare
ReportReport
Posted on by 29

Hey community,

 

I'm working at a car manufacturer where we want to built an app to manage our batteries of EVs. Bascially battery meta data, used raw materials, costs, weight, recycability, ..... All this data is managed for the next 10-20 years and should be used mainly in charts for forecasts. To store the data we thought to use the dataverse and i created a few tables because i think that the data is highly related.

 

Tables:

Battery: Bat ID, Name, Total Weight

RawMaterial: Mat ID, Name

MaterialPriceMap: LookUp to RawMaterial, Price p ton (2022 to 2042)  (>> 20 columns)

BatteryMaterialMap: LookUp to Battery, LookUp to RawMaterial, Amount of RawMaterial

 

One thing we want to do is to join the BatteryMaterialMap with the MaterialPriceMap to calculate the material cost or weight for one or multipple batteries for the next years. This data shall be shown as charts to have a management friendly forecast.

I'm not even sure of the approach with 20 columns (one for each year) is the best solution.

 

Now my questions

  1. How can i join the data from different tables and do calucation on the data. IN SQL i would use a view and simply join the data.
  2. Is the apprach with a column for each year a good approach or do you have better ideas. I had the idea for a single line column but was not able to view it as a chart

Many Thanks in advance

 

Martin

I have the same question (0)
  • Ram Prakash Duraisamy Profile Picture
    5,877 Super User 2026 Season 1 on at

    Hi @mintenm 

     

    You need to use Microsoft Flow to Achieve this type of Behavior.

     

    We can use Rollup Field but the Rollup with work only with Related Tables.

     

    Please mark as Answer if it is helpful and provide Kudos


    Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
    Follow me on Twitter : @rampprakashd
    Blog : https://microsoftcrmtechie.blogspot.com

  • klein-tail Profile Picture
    18 on at

    It sounds like you want to create time series data for a EV battery.

     

    I would first create MaterialPrice table having Price/ton(including past price and forecast price), Date of that price printed(from market data, i guess?), Look up to raw material.  Then Battery Table will have a child Table called Battery Price.  To create a Battery Price record, I would create a Time triggered PowerAutomate flow(runs weekly, monthly?) or do a calculation part in Azure Function. The catch here is, I think, to have time series data for an EV battery which should be almost ready to use for visualization.

     

  • mintenm Profile Picture
    29 on at

    @klein-tail 

    I think you're right. Time is at least very important so time series is right.

    The battery price itself is not that important, but we want to estimate how much raw material we need, incase we produce every year e.g. 10% more batteries, how much will this cost, how much can we save when we recyle 85, 90, 95 ... % of the raw materials. Its a lot "playing" with the data.

     

    All data from the past we get from the market, everything from the future is estimating/forecasting on a yearly basis.

     

    Currently we use excel for it, but the no. of users is increasing and not everyone can handle the excel without errors.

     

    Based on your input i saw already one improvment: until now i can merge the rawMaterial tabe with the rawMaterialPrice table, since the price is the only time based information.

     

    I read something about collections. Is it also possible to create a collection from data in tables? I did not find something about create collection from table data. Only from UI inputs.

     

  • klein-tail Profile Picture
    18 on at

    @mintenm 

    > we want to estimate how much raw material
    This sounds like you want to do a simulation of production cost. Do you want to do it on a Model-driven app or a Canvas app?

    If the calculation model is simple, then building a Model-driven simulation app sounds okay to me but if a lot “playing” with the data is involved, why not use Excel? I’m working at a home building company and we had a requirement from management to estimate next year’s cost. There are way too many variables (wood, cement, various pipes, labors, and so on) so we ended up coming back to Excel for inputting variables for cost simulation. Not sure about EV battery but once you want a cost estimate to be as precise as possible, doesn’t it require complex calculations? In our case, we realized that there would be too many input fields in UI so getting back to Excel was a realistic/feasible way.

    the collection you refer to sounds like getting dataverse records through formulas in a Canvas app. You can join collections from different dataverse tables.

  • mintenm Profile Picture
    29 on at

    Since i'm a newbie i had to check the difference. Since i'm using data verse i would say i will use a model driven app.

     

    Your example with the home building is pretty well matching with our thought. Its a bit of open evaluation how to do it. Option 1 is PowerApps and Option was to build a "real" app. Using Excel is the current solution and the final result can be that we continue with excel. 

     

    Do you haven an example or link how to create a collection from 2 tables in the dataverse. Th eonly info i find is creating collection from UI input.

  • klein-tail Profile Picture
    18 on at

    Joining two collections is sort of like brain teasers if you are from SQL world.  lets say you have two collections as follows:

     

     

    ClearCollect(Customer,
    {CustID:1,CutstomerName:"Alfreds Futterkiste",Country:"Germany"},
    {CustID:2,CutstomerName:"Ana Trujillo",Country:"Mexico"},
    {CustID:3,CutstomerName:"Antonio Moreno Taquería",Country:"Mexico"});
    ClearCollect(Order,
    {OrderID:10308,CustID:2,ShipDate:Date(1996,9,18),ShipperID:3},
    {OrderID:10309,CustID:37,ShipDate:Date(1996,9,19),ShipperID:1},
    {OrderID:10310,CustID:77,ShipDate:Date(1996,9,20),ShipperID:2})

     

     

    Inner join would look like this:

     

    DropColumns(
     Filter(
     Ungroup(
     AddColumns(
     Customer,
     "order",
     Filter(
     RenameColumns(
     Order,
     "CustID",
     "OCustID"
     ),
     CustID = OCustID
     )
     ),
     "order"
     ),
     !IsBlank(OCustID)
     ),
     "OCustID"
    )

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 494

#2
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#3
11manish Profile Picture

11manish 323

Last 30 days Overall leaderboard