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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Problems merging tables on date as key.

Hi,

 

I am trying to change calendar dates in my report to financial.

 

My method to do this was to create a new table then match on to the date Key.

 

Date =

  GENERATE (

    CALENDAR ( DATE ( 2014, 1, 1 ), DATE ( 2021, 12, 31 ) ),

    VAR currentDay = [Date]

    VAR day = DAY( currentDay )

    VAR month =  MONTH ( currentDay )

    VAR year =  YEAR ( currentDay )

VAR FiscalQuarter = IF(month=1,"4",IF(month=2,"4",IF(month=3,"4",IF(month=4,"1",IF(month=5,"1",IF(month=6,"1",IF(month=7,"2",IF(month=8,"2",IF(month=9,"2",IF(month=10,"3",IF(month=11,"3",IF(month=12,"3"))))))))))))

VAR FY = IF(month<=3,"FY"&RIGHT(year-1,2),"FY"&RIGHT(year,2))

  RETURN   ROW (

    "day", day,

    "month", month,

    "year", year,

"quarter", FiscalQuarter,

"fy", FY ))

 

My other table has the key as dd/mm/yyyy format.

 

The tables are not matching. I merged them on date as 1 to 1.

 

Is it because the new table includes a time stamp of 00:00:00?

 

If so, I changed this in the modelling format ribbon but it still does not merge when I try to create a matrix, using the new financial dates from the new table.

 

Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I solvd this.

 

I had to change the formats in the modelling to both the exact same.

 

Strangely it changed the date to a text field in the column not created by DAX

View solution in original post

1 REPLY 1
Anonymous
Not applicable

I solvd this.

 

I had to change the formats in the modelling to both the exact same.

 

Strangely it changed the date to a text field in the column not created by DAX

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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