Forum Discussion

gtamir's avatar
gtamir
Icon for Post Patron rankPost Patron
7 years ago
Solved

Date table in multi fact environment

Can anyone help me to complete the formula? I want to build myself the date table in a Multi Fact Table environment but I have an error. Thanks DATE = ADDCOLUMNS(CALENDAR (DATE(YEAR (MIN (MIN(Fact...
  • MFelix's avatar
    7 years ago

    HI gtamir ,

     

    Asuming that you want the max and minimum year of the two refer columns to get beginning and ending of calendar try the following:

    DATE =
    ADDCOLUMNS (
        CALENDAR (
            DATE ( YEAR (
                MIN ( MIN ( FactInternetSales[DueDate] ), MIN ( FactResellerSales[DueDate] ) )
            ), 1, 1 ),
            DATE ( YEAR (
                MAX ( MAX ( FactInternetSales[DueDate] ), MAX ( FactResellerSales[DueDate] ) )
            ), 12, 31 )
        ),
        "Year", YEAR ( [Date] ),
        "Month Number", MONTH ( [Date] ),
        "Month Name", FORMAT ( [Date], "mmmm" ),
        "Quarter", "Q" & INT ( FORMAT ( [Date], "q" ) )
    )

    Regards,

    MFelix