Forum Discussion

bojangles35's avatar
bojangles35
Regular Visitor
4 years ago

Date Time Circular Dependency

I'm having trouble with A date table to plot two values on the same line graph with date as the x axis.  I've tried a date table and hour table as well but above is the simplest represenation.  My "New Well Forecast" table only has one value per date while the "Production" table has a value for every hour of every day.  When I plot this chart with the relationships above, it only shows the Date/Times that are in the "New Well Forecast Table" and shows no values from the production table.  

 

I've tried a number of different solutions.  The new well forecast table should really be merged with the production table but the production table is a direct import.  I can't do it in SQL either.  Can anyone help me out?  

 

Thanks

4 Replies

  • bojangles35 , In this case, your Date needs to be date-time table.

    Then you can join it with production and datetime and with forecast  on Date (Many to Many) , but that should work fine.

    If needed, you can separate date table too, which join with date from both tables. In case of Production you have create a date without timestamp to join

     

     

    Date = [datetime].date
    or
    Date = date(year([datetime]),month([datetime]),day([datetime]))

    in Power Query
    DateTime.Date([datetime])

    • bojangles35's avatar
      bojangles35
      Regular Visitor

      Hi amitchandak,

       

      Thanks for the help and sorry for the late reply.  I am linking both tables to the Date Table with Date/Time and have all hours of the day for the Date table and production table but only one hour for the Forecast table.  I wrote my question quickly so missed some things.  I need to filter everything by "Well".  This is the unique identifier in the "Well" Table but is in all three tables and the connection between all of them.  .  

       

      The filtering seems to acutally be the issue.  I have a slicer for "Well" from the New Forecast Table.  When the relationship between the Well table and New Well Forecast table is both directions as in my original post, I only get the "Date/Time" that's in the New Well Forecast Table for the "Gas Actuals" from the production table.  It should have all hours of the day.  

      If I have the relationship as single directional filter as below, the Date/Time aspect works but the "Well" Slicer doesn't do anything, all wells are always selected.  (You can see this in the 12/2 12:00 AM as the previous 5853 doesn't match below because there are two "Wells" even though the slicer has one).  

       

       

       

       

  • V-lianl-msft's avatar
    V-lianl-msft
    Community Support

    Hi bojangles35 ,

     

    The relationship of your model is wrong,please try what said before, then try to create a measure to calculate the two values you want

     

    Best Regards,
    Liang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • bojangles35's avatar
      bojangles35
      Regular Visitor

      I'm not sure what you mean but see below for more details.  Thanks.