Forum Discussion

carlol's avatar
carlol
Resolver I
4 years ago

Date not joining correctly

 

I deleted all tables but these two 

 

  1. Fact 
  2. Dim Date

 

  • this works fine in SQL 
  • In powerBI both are of type date 

 

For some strange reason , some rows it returns blank others , it will pick up HospArrDate July 01 as Q3 2021

 

3 Replies

  • selimovd's avatar
    selimovd
    Most Valuable Professional

    Hey carlol ,

     

    that means that there is no data for that date.

    The "join" works, just your data is most likely lacking some dates.

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     
    • carlol's avatar
      carlol
      Resolver I

      Both data tables have corresponding dates ,  verified in SQL ; I also filtered the date July 01 2021 out within the PB data model for both tables 

       

      Changed the data types for DimDate (col Date)  and  Fact (HospArrDate) to date in Power Query  , just to be sure

       

      Still illustrates blank

       

       

  • I created a new PBIX file , just incase

     

    Very strange , why it is not picking up some of the dates , randomly join on the majority and others are blank

     

    Is it worth trying to convert to a datekey of type int

     

    Tried Power Query convery Datetime to a date and also casting to a date in SQL prior load

     

     


    Select [HospArrDate],d.*
    From
    --[KPI].[vwMedianDoorToNeedle]
    --[KPI].[vwMedianDoorToNeedle]
    [KPI].[vwMedianDoorToCT]
    Inner join [Dim].[Date]D On [HospArrDate] = D.Date
    Where
    DateKey = '20180225'