cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver II
Resolver II

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.

 

PBI screenshot.jpg

 

 

I'm posting links to my data here:

 

My pbi file

My excel sheet (used as source for pbi file)

 

Any help is appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft
Microsoft

Re: Getting wrong project dates when generating table...

Hi @ccapowerbi

 

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
)

1.png

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Resolver II
Resolver II

Re: Getting wrong project dates when generating table...

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.
Highlighted
Microsoft
Microsoft

Re: Getting wrong project dates when generating table...

Hi @ccapowerbi

 

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
)

1.png

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Resolver II
Resolver II

Re: Getting wrong project dates when generating table...

Hey @v-cherch-msft

 

Thanks for taking the time to reply. Your solution works. I'm posting both PBIX files--one with my solution & one with yours so people can see both. 

 

ADDCOLUMNS / GENERATE / SELECTCOLUMNS solution

FILTER / GENERATE / SELECTCOLUMNS solution

 

Thanks so much.

 

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Community Summit Australia – Join Online!

Community Summit Australia – Join Online!

Be a part of the leading Microsoft Business Applications digital event, curated for the APAC community.

Top Solution Authors
Top Kudoed Authors