Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
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 | Monthly | Est Start Date | Est End Date |
100 | 1 | $ 12,000.00 | $12,000.00 | 1/1/2019 | 1/31/2019 |
200 | 3 | $ 10,000.00 | $3,333.33 | 2/1/2019 | 4/30/2019 |
300 | 2 | $ 3,000.00 | $1,500.00 | 1/1/2019 | 2/28/2019 |
400 | 4 | $ 8,000.00 | $2,000.00 | 3/1/2019 | 6/30/2019 |
500 | 2 | $ 2,000.00 | $1,000.00 | 2/1/2019 | 3/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 excel sheet (used as source for pbi file)
Any help is appreciated.
Solved! Go to Solution.
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 )
Regards,
Cherie
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:
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 )
Regards,
Cherie
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.
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.