I would like to Assign A Number to Particular Date based on the month in my Table.
Ideally a calculated column that complete this tasks:
1 = All Dates within the Month of (May)
2 = All Dates within the Month of (June)
3 = All Dates within the Month of (July)
4 = All Dates within the Month of (Aug)
5 = All Dates within the Month of (Sept)
This Logic provided above appears to be resetting for May 2016 back to Month 1 and beyond. Is it possible to make May 2016 and beyond cumulative, so that would be Month 13 and so on?
Let me emphasize that this is not a Measure but a Calculated Column added to your Sales table.
This will return a cumulative number from the first year in the data
Assigned number Cum from first date =
VAR myMonth = MONTH(Sales[Part 1 Out])
VAR firstYear = YEAR( MINX( ALL( Sales[Part 1 Out] ), [Part 1 Out] ))
VAR myYear = YEAR( Sales[Part 1 Out] )
RETURN
IF( myYear >= firstYear,
IF( myMonth >= 5, myMonth-4, 12-(4-myMonth)) +
12 * (myYear - firstYear )
)
Thanks for your help last week on the calculated column, that counts through my projects per month.
I would really like to explain and the formula provided last week, if we can.
For some context, there are Two Procurement Frameworks in the in the Table you were helping on. Specifically Column Name “Generation” shows numbers 3 and 4 respectively.
These two Frameworks run for the following duration’s:
Generation 3 runs from 15/May/2015 to the 15/May/2019, Totalling 48 Months.
Generation 4 runs from 15/May/2019 to the 15/May 2023, Totalling 48 Months.
The total of both Framework Generations being 96 months.
At present the cumulative column isn’t taking the generations 3 & 4 into account when completing the calculation. Is it possible to account for this variation in the code?
Looking at your data, a new Generation isn’t assigned on May 15th like you’ve described.
This code now creates a cycle of 48 months in each Generation (starting May 1st).