Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

CALENDAR

Hi all!

I need to get the min & max date vale from 2 or more different fact tables in order to create a dynamic Master Calendar.

Any idea? I used to use "||" but seems it doesnt work right now.
 
Right now I have the following script:
Calendar = ADDCOLUMNS (
    CALENDAR (min(Sesiones[createDate]) ; max(Sesiones[createDate]))
  • Hi  Anonymous ,

     

    I created 3 date tables as a sample:

     

    Then you need first to create a new table combing all the dates using below dax expression:

     

    Table 2 = 
    UNION(DISTINCT('Table'[Date]),DISTINCT('Table (2)'[Date]),DISTINCT('Table (3)'[Date]))

     

    Finally create a new table to get a calendar date containing the min date and max date:

     

    Table 3 = CALENDAR(MIN('Table 2'[Date]),MAX('Table 2'[Date]))

     

    And you will see:

    For the related .pbix file,pls click here.

     

    Best Regards,
    Kelly
    Did I answer your question? Mark my post as a solution!

     

     

2 Replies

  • v-kelly-msft's avatar
    v-kelly-msft
    Community Support

    Hi  Anonymous ,

     

    I created 3 date tables as a sample:

     

    Then you need first to create a new table combing all the dates using below dax expression:

     

    Table 2 = 
    UNION(DISTINCT('Table'[Date]),DISTINCT('Table (2)'[Date]),DISTINCT('Table (3)'[Date]))

     

    Finally create a new table to get a calendar date containing the min date and max date:

     

    Table 3 = CALENDAR(MIN('Table 2'[Date]),MAX('Table 2'[Date]))

     

    And you will see:

    For the related .pbix file,pls click here.

     

    Best Regards,
    Kelly
    Did I answer your question? Mark my post as a solution!