Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Min date & Max date from 3 tables to create Datetable

Hi, I have small requirment where in I have 3 different tables out of all this 3 I have to create 1 date table and I should pick min date from all the 3 tables and max out of all and create new tabl...
  • Mahesh0016's avatar
    3 years ago

    Anonymous Please reffer Below Code

    Date 4 =
    VAR DD = UNION (
        SELECTCOLUMNS ( 'Date', "Date", 'Date'[Date] ),
        SELECTCOLUMNS ( 'Date 2', "Date", 'Date 2'[Date] ),
        SELECTCOLUMNS ( 'Date 3', "Date", 'Date 3'[Date] )
    )
    VAR MIN_Date = MINX(DD,[Date])
    VAR MAX_Date = MAXX(DD,[Date])

    RETURN
    CALENDAR(MIN_Date,MAX_Date)


    Anonymous If this post helps, then please consider accepting it as the solution to help other members find it more quickly.THANK YOU!!