Forum Discussion

Daxer12's avatar
Daxer12
Helper I
6 years ago
Solved

append two tables using measure

Hi guys,

 

I have a table which looks like the following:

ProjectphasesstartDate (as a measure)endDate (as a measure)EstCost
Aa11/01/20201/08/2020100
Aa21/08/20201/08/2021200
Aa31/08/20211/11/2021300

In the above tables, Start and End dates are measures and they can be changed by the users based on their selection 

How do I append a dynamic month/year in this table so the result looks something like this:

 

ProjectphasesstartDate (as a measure)endDate (as a measure)EstCostDynmicDate
Aa11/01/20201/08/2020100Jan-20
Aa11/01/20201/08/2020100Feb-20
Aa11/01/20201/08/2020100Mar-20
Aa11/01/20201/08/2020100Apr-20
Aa11/01/20201/08/2020100May-20
Aa11/01/20201/08/2020100Jun-20
Aa11/01/20201/08/2020100Jul-20
Aa21/08/20201/08/2021200Aug-20
Aa21/08/20201/08/2021200Sep-20
Aa21/08/20201/08/2021200Oct-20
Aa21/08/20201/08/2021200Nov-20
Aa21/08/20201/08/2021200Dec-20
Aa21/08/20201/08/2021200Jan-21
Aa21/08/20201/08/2021200Feb-21
Aa21/08/20211/08/2022200Mar-21
Aa21/08/20211/08/2022200Apr-21
Aa21/08/20211/08/2022200May-21
Aa21/08/20211/08/2022200Jun-21
Aa21/08/20211/08/2022200Jul-21
Aa31/08/20211/11/2021300Aug-21
Aa31/08/20211/11/2021300Sep-21
Aa31/08/20211/11/2021300Oct-21
Aa31/08/20211/11/2021300Nov-21

 I need help to expand the table with a dynamic date (which is a date range between start and end dates of phases on a monthly increment). 

thanks

Daxer

  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi Daxer12 ,

     

    1.Create a calendar table. There is no relationship between two tables.

     

    Calendar =
    ADDCOLUMNS (
        CALENDAR ( DATE ( 2020, 1, 1 ), DATE ( 2021, 12, 31 ) ),
        "MonthYear",
            FORMAT ( [Date], "MMM" ) & "-"
                & FORMAT ( [Date], "YY" ),
        "Sort", FORMAT ( [Date], "YYYYMM" )
    )

     

     

    2.Create a measure and put it into Filters to filter table.

     

    Measure =
    IF (
        MIN ( 'Calendar'[Date] ) >= 'Table'[startDate]
            && MIN ( 'Calendar'[Date] ) < [endDate],
        1,
        0
    )

     

     

     

    You can check more details from here.

     

     

     

    Best Regards,
    Stephen Tao

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies