Forum Discussion
Life Cycle Calculation
- 3 years ago
Hi , Deem
I download your .pbix file , For your problem, Here are my answers:
(1)At present, the value you modified is correct, and you can return the correct table, where 2050 means that the year of the generation stops in 2050, and the deadline for the generation is not specified in your table, so you need to replace the value with 2050.
(2)For the [life] field , you can edit the M language in "Aangepaste kolom toegevoegd" step:
= Table.AddColumn(#"Type gewijzigd", "Aangepast", (x)=> List.Generate(()=>x[endyear]+x[life],(y)=> y<=2050 , (y)=>y+x[life] ) )Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Deem Here is a DAX solution. Basically Blowout! PBIX is attached below sig.
Blowout! =
VAR __Table =
GENERATE(
'Table',
VAR __MinYear = [endyear]
VAR __increment = [life]
RETURN GENERATESERIES(__MinYear,__MinYear + __increment * 3,__increment)
)
RETURN
__Table
HI Greg_Deckler ,
I wil try this solution later this day on my big dataset. I've tried it and it works on the test dataset. I will let you know if it works fine. Thanks!
- v-yueyunzh-msft3 years ago
Community Support
Hi , Deem
I download your .pbix file , For your problem, Here are my answers:
(1)At present, the value you modified is correct, and you can return the correct table, where 2050 means that the year of the generation stops in 2050, and the deadline for the generation is not specified in your table, so you need to replace the value with 2050.
(2)For the [life] field , you can edit the M language in "Aangepaste kolom toegevoegd" step:
= Table.AddColumn(#"Type gewijzigd", "Aangepast", (x)=> List.Generate(()=>x[endyear]+x[life],(y)=> y<=2050 , (y)=>y+x[life] ) )Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- Deem3 years agoFrequent Visitor
Hi Greg_Deckler , your solutions works also fine. The only thing is that it generates much more new rows because of the incrementfactor then the solution of v-yueyunzh-msft. So I have chosen the solution of v-yueyunzh-msft for my case.
Many thanks for your quick replies!!💪💪