Forum Discussion

jgil's avatar
jgil
Frequent Visitor
6 years ago
Solved

Many to Many relationship

Hello,   I have two tables Table A and Table B, in table A is the calendar table we have a column its name is year month this is the format (YYYYMM), table B is a cross-sectional table with the sam...
  • sanimesa's avatar
    sanimesa
    6 years ago

    jgil

    If that does not work, create a dummy calculated date field in the fact table. Say, assume the day to be 1. Then you will be able to build the relationship with this date and the calendar and it will work the way you want to.

     

    You can use a formula like this:

     

    TheDate = 
    VAR yearmonth = CONVERT(YearMonthTable[YearMonth], STRING)
    VAR year = VALUE(LEFT(yearmonth, 4))
    VAR month = VALUE(RIGHT(yearmonth, 2))
    
    RETURN DATE(year, month, 1)