Forum Discussion
Splitting Values between months of two dates
- 9 years ago
To achieve it, you need to create a calendar table and crossjoin your original table and this calendar table.
In your original table, create a column use the DAX below.
CostPerMonth = Table1[Cost]/(DATEDIFF(Table1[StartdDate],Table1[EndDate],MONTH)+1)Create a calendar table
Calendar = FILTER(CALENDAR("2016-01-01","2017-12-31"),DAY([Date])=1)Crossjoin those two tables.
Table = FILTER(CROSSJOIN(Table1,'Calendar'),'Calendar'[Date]>=Table1[StartdDate]&&'Calendar'[Date]<=Table1[EndDate].[Date])And then you can show your expected result by using a martix visual.
Regards,
Charlie Liao
I also need to split values between dates. I tried to do the process you explained and the first part worked perfectley. I created a column using DAX and created a calendar table:
"The expression refers tu multiple columns. Multiple columns cannot be converted to scalar value"
This is the DAX formula I am using: FILTER(CROSSJOIN('Dedication planned','Calendar'),'Calendar'[Date]>='Dedication planned'[Start]&&'Calendar'[Date]<='Dedication planned'[Finish].[Date]
Basically what I need is to create a new table (or column) where the total days are split evenly per quarter. When split, I need the days to be filter by Name and project code as well. For instance:
| Project Code | Lead | Start | Finish | Total Days |
| PCCO001 | Jhon | 25.01.2020 | 08.04.2020 | 4 |
| PCCO003 | Jhon | 13.03.2020 | 09.06.2020 | 2 |
| PCCO001 | Jose | 30.09.2020 | 30.12.2020 | 2 |
Desired result will be something like this:
| Project Code | Quarter | Lead | Days |
| PCCO01 | Q1 | Jhon | 2 |
| PCCO01 | Q2 | Jhon | 2 |
| PCCO01 | Q3 | Jose | 1 |
| PCCO01 | Q4 | Jose | 1 |
| PCCO03 | Q1 | Jhon | 1 |
| PCCO03 | Q2 | Jhon | 1 |
Hope I can find a solution to this. Thanks!