Forum Discussion
DAX working with two dates
I was working on a dax problem.
I have the resource allocation from start date to end date....
I need to consider the average meaning divide by 12, However when we have start date or end date in between the year we need to sum up for the months available and divide By 12
example
resource allocation start date end date
0.3 Aug 2021 March 2023
the result should show the allocation for 2021 0.3*5/12=0.125
the result should show the allocation for 2022 0.3*12/12=0.3
the result should show the allocation for 2023 0.3*3/12=0.075
Anonymous , refer if these approaches can help
Measure way
Power BI Dax Measure- Allocate data between Range: https://youtu.be/O653vwLTUzM
Tables way
https://amitchandak.mediumcom/dax-get-all-dates-between-the-start-and-end-date-8f3dac4ff90b
https://amitchandak.medium.com/power-query-get-all-dates-between-the-start-and-end-date-9ad6a84cf5f2
3 Replies
- FreemanZSuper User
hi Anonymous
are you expecting a measure? if so, what context do you have for that measure or how are you going to use that measure?
- AnonymousNot applicable
FreemanZ
yes I am expecting a measure.. ill be using a matrix with all attributes as rows, year as column and measure as values- amitchandakSuper User
Anonymous , refer if these approaches can help
Measure way
Power BI Dax Measure- Allocate data between Range: https://youtu.be/O653vwLTUzM
Tables way
https://amitchandak.mediumcom/dax-get-all-dates-between-the-start-and-end-date-8f3dac4ff90b
https://amitchandak.medium.com/power-query-get-all-dates-between-the-start-and-end-date-9ad6a84cf5f2