Forum Discussion

Rirhandzu's avatar
Rirhandzu
Regular Visitor
1 year ago
Solved

Three years cycle grouped column

i need to create a column in powerbi that will group years
so i want to do a 3 years cycle time
if column year is:
2016,2017,2018 return 2018,
and
2017,2018,2019 return 2019
and
2018,2019,2020 return 2020
and
2019,2020,2021 return 2021
and
2020,2021,2022 return 2022
and
2021,2022,2023 return 2023
and so on

in this data 2022 is missing keep the sequence and treat it as missing data but the sequence
must not change and if year is null return null

then sequence must continue like this ,
make sure that even if the year is included in the first group or the previous group it must be included also on the next group following the sequence