Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Getting wrong project dates when generating table...

Hello PBI community:

 

I'm tracking revenue for projects over a few months; some projects generate revenue, and others stop (i.e., not cumulative total). 

 

I have a table that has one row for each project, but some projects span a few months. I need a row for each month each project spans. I have that down, but now I'm having an issue with the dates in the table I'm generating. I want the first row for a project to have a date that matches the start date of the project (and the second row to be the first date of the month for the next month the project generates revenue, and so on for subsequent months--to be clear, once we start work on a project, we continuosly work on it until it is completed).

 

Here is a table that shows each project with start & stop dates:

Project #Duration (Months) Expected MonthlyEst Start DateEst End Date
1001 $   12,000.00$12,000.001/1/20191/31/2019
2003 $   10,000.00$3,333.332/1/20194/30/2019
3002 $     3,000.00$1,500.001/1/20192/28/2019
4004 $     8,000.00$2,000.003/1/20196/30/2019
5002 $     2,000.00$1,000.002/1/20193/31/2019

 

The image below shows the first date for project 200, and it is incorrect.

 

 

 

I'm posting links to my data here:

 

My pbi file

My excel sheet (used as source for pbi file)

 

Any help is appreciated.

  • Hi Anonymous

     

    Please check if below table matches your request.

    Table = 
    FILTER (
        GENERATE (
            SELECTCOLUMNS ( 'My Date Table', "My Date", 'My Date Table'[Date] ),
            Projects
        ),
        Projects[Est Start Date] <= [My Date]
            && Projects[Est End Date] >= [My Date]
            && DAY ( [My Date] ) = 1
    )
    

    Regards,

    Cherie

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    For those who are curious, the 'temporary' table returns a number labeled [Value]. It seems to correspond to the month number. The fix is changing the expression associated with the 'Month' column in the table generated by SELECTCOLUMNS. I set the expression to this:

     

    "Month", DATE(YEAR([Est Start Date]),[Value],1),
     
    That gave me the appropriate date value for my rows. 
     
    **You have to use [value] in the calculation as that is how the dates differ from line to line.**
     
    If you don't use [Value], the table will apply the same date under the month column to each row. [Value] is the key to giving each row for a project (that spans more than 1 month) a different date.