Relationship Issues With DateTime Data Types in Power BI

Поделиться
HTML-код
  • Опубликовано: 1 авг 2024
  • Learn about a potential pain point when it comes to dealing with DateTime data in a fact table. You can potentially encounter an issue when joining your fact to a calendar table. Specifically if you import a Fact table into your model with a datetime column, and convert that column to a date data type in the model, instead of in Power Query. If you do this then that relationship still won't work until you make that change in Power Query.
    RELATED CONTENT 🔗
    PQ Vs. DAX Data Types -- endjin.com/blog/2020/03/power...
    BECOME A CHANNEL MEMBER 🎉
    -- / @havensconsulting
    LET'S CONNECT! 🧑🏽‍🤝‍🧑🏽 🌟
    -- / havensbi
    -- / reidhavens
    -- / havensconsulting
    VIDEO CHAPTERS 🎥
    0:00 - Start of Video
    0:40 - Start of Demo
    2:55 - Power Query Vs. DAX Data Types Blog
    HAVENS CONSULTING PAGES 📄
    Home Page - www.havensconsulting.net
    Blog -- www.havensconsulting.net/blog-...
    Blog Files -- www.havensconsulting.net/blog-...
    Files & Templates -- www.havensconsulting.net/files...
    Consulting Services -- www.havensconsulting.net/consu...
    Online Courses -- www.havensconsulting.net/onli...
    Contact & Support - www.havensconsulting.net/conta...
    EMAIL US AT 📧
    info@havensconsulting.net
    #PowerBI #powerplatform #microsoft #businessintelligence #datascience #data #dataanalytics #datavisualization #dashboard #bi #analytics #powerquery #dax #datatypes #datamodeling #powerquery #dax
  • НаукаНаука

Комментарии • 102

  • @benharris8073
    @benharris8073 2 года назад +3

    THANK YOU so much for this. I had been pounding my head against my desk for the last 2-hours trying to figure out what the problem was. Bravo!

  • @PDOT1990
    @PDOT1990 9 дней назад

    You are a God send!!! The way I have been stuck on this for 4 hours going back and fourth. Thank you so much.

  • @AgulloBernat
    @AgulloBernat 3 года назад +2

    Experienced that myself! I could not believe what was happening so i created a calculated column in dax with the year month and day of the column and worked! Now I understand why 😀

  • @travisgordon4750
    @travisgordon4750 Год назад

    You are a hero! I bashed my head against this for an hour this morning before figuring out what question I needed to ask, which was answered right here! Thank you!

  • @Dude276175
    @Dude276175 Год назад

    I wish I would have discovered this a week ago! I have been trying to join a Date field to a Date/Time field and had no idea why nothing was work. Thanks!!!!😀

  • @gabrielmorais7312
    @gabrielmorais7312 3 года назад

    Wow, this is great. Thanks Reid!

  • @aleksandrmolchanov827
    @aleksandrmolchanov827 2 года назад +3

    Brilliantly explained! Thank you for your elaboration and for being on the point! A+++

  • @ChrisSmithFW
    @ChrisSmithFW 2 года назад

    Fantastic video! Have wracked my brain all week on this issue! Much appreciated!

  • @pabeader1941
    @pabeader1941 3 года назад +3

    Thanks! This has been driving me nuts for years. I kinda understood what was going on, but your explanation put it in front of me where I could really see it.

    • @HavensConsulting
      @HavensConsulting  3 года назад

      Thank you! I wished PBID made it more clear about this issue, which is why I made this video.

    • @norpriest521
      @norpriest521 3 года назад +1

      @@HavensConsulting
      I sat through this pain for about a day and tried to figure out what I did wrong and implemented so many solutions and it still didn't work until 15 mins ago when I accidentally found a comment in some power bi community website.
      Some guy said "Open it with Power Query" so I tried it and I was like dying.
      I mean how could someone figure this out?
      In fact, Microsoft should put this issue in the first page of power bi training material saying that "DO NOT CHANGE DATE TIME DATA TYPE ON POWER BI BECAUSE IT'S USELESS AS HELL AND USE POWER QUERY INSTEAD, FOR THE LOVE OF GOD!!!"
      I think this is the worst bug i ever found in power bi.
      Have you ever encountered a worse bug than this one? 😂

    • @HavensConsulting
      @HavensConsulting  3 года назад +1

      @@norpriest521 Yeah sadly I agree. I've given candid feedback to the Power BI team that this needs to be updated. Since it's the ONLY type conversion you do that DOESN'T actually change the type. :\

  • @joshstone313
    @joshstone313 4 месяца назад

    OH MY GOSH - Thank you so much for this! Many, many hours later. As a Power BI beginner, this was so not obvious.

  • @catherinevisitacion3531
    @catherinevisitacion3531 2 года назад

    Thank you! Really helped me with my work! More blessing to you!!!

  • @michelmolongo
    @michelmolongo Год назад

    This is fantastic ! You made my day. Cheers

  • @EricHartwigConsulting
    @EricHartwigConsulting 3 года назад

    Oh Wow! You break this down into a great explanation and example! Thank you so much for this information!

  • @nileshpancholi74
    @nileshpancholi74 2 года назад

    What a great video that just saved me from hours of pulling my hair out. I completed the changes you suggest in the video and a model I created just all fell into line. Can't thank you enough.

  • @jimmyxrs
    @jimmyxrs 9 месяцев назад

    Your are a lifesaver! Was driving me mad and this was the exact issue i was having and this solution worked a treat. Thank You! :)

  • @chrismengel3176
    @chrismengel3176 3 года назад +2

    Great video! I've found there are many nuances to making the most of time intelligence. Personally, I'm not fond of joining on a date - for this very reason. I've found that adding a column in Power Query with this simple formula (=Number.From()) converts my date column into an integer value. I use this column in my Date Table as primary key to join to other tables that have dates. The tables I join have a date foreign key column that uses the same formula. Now I'm joining on integer values, which is my personal preference. Keep up the great work!

    • @sedwards2207
      @sedwards2207 Год назад

      Great idea, Chris. I’ll give that a try.

  • @BenShay
    @BenShay Год назад

    Thank you for saving me more hours of frustration.

  • @gabrielcoral2858
    @gabrielcoral2858 2 года назад

    I lovvvvvveeeeeeeee you, i've been literally looking for this a whole week in powerbi forums and i got nothing.
    You got a new subscriber

    • @HavensConsulting
      @HavensConsulting  2 года назад

      I'm glad I could help! It's been a major pain for so many people! 😅

  • @user-dn3il1gb3n
    @user-dn3il1gb3n 9 месяцев назад

    brilliant!!! you explained really well, I finally understood the problem! Thanks!!!

  • @rajivjani8594
    @rajivjani8594 2 года назад

    Many thanks for sharing this information! It helps!

  • @ruesaintdenis
    @ruesaintdenis 3 года назад

    Very grateful for this, thank you!

  • @ZZstarX2855
    @ZZstarX2855 2 года назад

    Thank you for this great explanation!

  • @bronaghquinn2081
    @bronaghquinn2081 Год назад

    Great video, saved me a lot of time - thank you

  • @jakeryan56
    @jakeryan56 2 года назад

    You are an absolute lifesaver!!!!

  • @mr.somebody6368
    @mr.somebody6368 2 года назад

    This saved me so much time, I wish I saw this earlier. Thanks a lot!!!

  • @kasperlj
    @kasperlj 2 года назад

    Thank you - saved me so much time!

  • @chandrasekhar1883
    @chandrasekhar1883 2 года назад

    yes it's very help full video. made my day. Thank you so much

  • @timothywaldman4945
    @timothywaldman4945 3 года назад

    This is great, thank you!

  • @usmansharifshaik1187
    @usmansharifshaik1187 2 года назад

    OMG !!
    For the last 3 hours, I am searching for this information. Man you saved me
    I can’t thank you enough. !!!!
    love from India

  • @JL_Klean
    @JL_Klean Год назад

    Thanks so much!! This was just what I was looking for.

  • @yichen5142
    @yichen5142 Год назад

    super helpful and well explained! The ref article is a treasure!
    Note, if any of the datetime columns contains a timestamp (e.g.yyyy,mm,dd,hh,nn,ss) then the other table should have hh,nn,ss in order to create a relationship.

  • @thedatastoryteller5692
    @thedatastoryteller5692 2 года назад

    thanks so much ! the last trick solved my issue! You are awesome!

  • @switchfire
    @switchfire 6 месяцев назад

    Thank you SO much. This saved me!

  • @jakoblauridsen4347
    @jakoblauridsen4347 2 года назад

    amazing you just saved my sanity!

  • @joelgamal1684
    @joelgamal1684 2 года назад

    Really THANK YOU so much, this helped me a lot

  • @LegoTP
    @LegoTP 2 года назад

    Straight to the point, you saved my report ;) thanks!

  • @mnowako
    @mnowako 3 года назад

    Good one 👍. Thank you.

  • @briang43
    @briang43 3 года назад

    No joke... I love you man! THANK YOU. This video just helped me keep my sanity with this project (for now)

  • @nicemovies99
    @nicemovies99 Год назад

    Thank you so much! Finally solved my issue!

  • @Festa_no_IML
    @Festa_no_IML 2 года назад

    saved me a lot of thought! thanks!

  • @gpkennedy34
    @gpkennedy34 10 месяцев назад

    Thank you so much. I've been battling with this issue for the past 3 days and could not figure out what I was doing wrong. Cheers!

  • @leakemi
    @leakemi 2 года назад

    Awesome!! 👏👏👏👏👏👏

  • @bibliosophist
    @bibliosophist 2 года назад

    That was very helpful. Thanks.

  • @vitorribas1910
    @vitorribas1910 Год назад

    This solved my problem, thank you!

  • @monishkumar3450
    @monishkumar3450 Год назад +1

    You saved me. Thank you !!

  • @marcovargas8086
    @marcovargas8086 2 года назад +2

    Not sure as to why, but using the locale option rather than just changing to date, which would result in errors, helped me achieve this.

    • @angelicavazquezhuizar752
      @angelicavazquezhuizar752 10 месяцев назад

      Wow! I was also getting errors, and I was only able to make it work thanks to you comment :)

  • @williamleveson-gower5088
    @williamleveson-gower5088 2 года назад

    Thank you, thank you, thank you !!!!.

  • @Yx9000
    @Yx9000 3 года назад

    Thank you it's work

  • @gborka
    @gborka 2 года назад

    Great tip

  • @gayathrivasudev6116
    @gayathrivasudev6116 5 месяцев назад

    Thanks a lot ... 🙏

  • @paulomodestoo
    @paulomodestoo Год назад

    Thanks bro! This video saved me!

  • @debasreetripathy5962
    @debasreetripathy5962 3 года назад

    Very helpful 🤠👍👍👍

  • @miqueldespuig
    @miqueldespuig 3 года назад

    I went crazy with one report until figured it out! Thanks Reid!

  • @sanaths4371
    @sanaths4371 Год назад

    Thank you

  • @matsjohnsson1096
    @matsjohnsson1096 2 года назад

    Thanks - was thinking I was an idiot trying to get it to work until I saw this video - thanks alot

  • @MrBobbybuche
    @MrBobbybuche Год назад

    I realize that this is a bit older video, and that this information may already be known, but thought I would share anyway. In my case, the data sets I am working with are somewhat large and I am, for reasons I won't go into here, having to pull it over VPN as well, so modifying my Power Query was not something I wanted to do unless I had to. It occurred to me that there might be another option, which led me to an alternative work-around for this issue. If you create a new column with DAX (e.g. Created = [MyDateTimeColumn].[Date]) and format it as Date with the ShortDate format, you can use the date table without breaking the date field, or having to add tons of items to your date table to match granularity.

    • @HavensConsulting
      @HavensConsulting  Год назад

      Great alternative! Yes if you can't apply a date extract in PQ, then a DAX column works just fine :)

  • @BaldNinjaChronicles
    @BaldNinjaChronicles Год назад

    I just wanted to say a huge thank you I was struggling with this a found it very difficult to find an answer.

    • @HavensConsulting
      @HavensConsulting  Год назад

      So happy it helped! Honestly my favorite video I recorded just because of how it helps people

  • @dinaalmajaly5169
    @dinaalmajaly5169 11 месяцев назад

    Life Saver

  • @komy4
    @komy4 2 года назад

    You saved my soul

  • @rollyv1687
    @rollyv1687 3 года назад

    Now this make sense

  • @MultiMortal
    @MultiMortal Год назад +1

    Excelent content. However, I need the other way around and show Date/Time. How can I make Power BI Desktop understand the same Date/Time format?

    • @HavensConsulting
      @HavensConsulting  Год назад +1

      Good question. If you have a fact table with both Date and Time dimensions it's recommended to have seperate dimension tables for each. Otherwise you'd need one row for every second between your start and stop date. That's 36 million rows per year! Here's a good article talking about splitting your date and time tables. radacad.com/how-to-use-time-and-date-dimensions-in-a-power-bi-model

  • @richardpierce919
    @richardpierce919 2 месяца назад

    Hi, if I have power query from t-sql that brings through datetime with zero seconds should I convert to date?

    • @HavensConsulting
      @HavensConsulting  2 месяца назад

      Definitely, I'd recommend converting any DateTimes to Date in Power Query before importing, if you don't need time, else best practice is having a separate Date and time Dim Table

  • @BigO_Notation
    @BigO_Notation 2 года назад

    Your help is appreciated, on my calendar date I see extra date compared to my fact table. Why is it not showing the same range? Thank you

    • @HavensConsulting
      @HavensConsulting  2 года назад

      Are you getting the min and max dates from your fact table or using the CALENDARAUTO function? If you make your calendar table using:
      CALENDAR( MIN(Fact[Date]), MAX(Fact[Date]) )
      Then your date range in the calendar table will match your fact table.

    • @BigO_Notation
      @BigO_Notation 2 года назад +1

      @@HavensConsulting I get the Max Date. Its working OMG. Thank you so much sir.

    • @havenscr
      @havenscr 2 года назад

      @@BigO_Notation glad to hear it! I'd check out my other calendar videos too! Plenty of good tips on making quality calendar tables

    • @HavensConsulting
      @HavensConsulting  2 года назад

      ruclips.net/video/AdLDYohLeJc/видео.html

    • @BigO_Notation
      @BigO_Notation 2 года назад

      @@havenscr definitely, I have been looking at your contents and will check out the rest. Thank you

  • @sabrinatorres4108
    @sabrinatorres4108 16 дней назад

    Hope this works for 😢

  • @JoeAverage2006
    @JoeAverage2006 3 года назад

    Is it possible to keep the imported column as datetime, and then have a calculated column that uses only the date part, and then join on the calculated column?

    • @HavensConsulting
      @HavensConsulting  3 года назад +1

      Absolutely! You could add that column either through Power Query, or through DAX. Personally I recommend PQ because it compresses the data a bit better during the refresh/import process.

    • @JoeAverage2006
      @JoeAverage2006 2 года назад

      @@HavensConsulting So if I want to keep the time part of the datetime data, but still want to join to a calendar date field - would you say the best option is to create an extra date-only calculated field in PQ and use that to join back to the calendar table? My only concern is that I have quite a few dates in my data, so would end up with a lot of duplicated date only columns. Thanks for the reply as well!

    • @havenscr
      @havenscr 2 года назад +1

      @@JoeAverage2006 that’s correct. The only way to join to a date only calendar table is you’d need a date key that is also date only

    • @JoeAverage2006
      @JoeAverage2006 2 года назад

      @@havenscr Thank you! I'll start creating those date only columns to join on. It is interesting, there are many calendar tutorials out there but almost no one mentions this.

    • @havenscr
      @havenscr 2 года назад

      @@JoeAverage2006 sure thing! My video on issues with date time from earlier this year talks about this as well 🙂