Skip to main content
Solved

Increment the values by 1 for each column

  • August 8, 2024
  • 2 replies
  • 135 views

Chahat
Master Helper
Forum|alt.badge.img+14

Hi folks,

I have a metric: “Start Week” of the datatype: “custom Weeks List” and using dimension “Project”. So, it has Start Week for every project. E.g. “Week 1” , “Week 27” for ABC, XYZ project respectively.

In the metric: “Calendar Week” of the data type: “Weeks” List and using dimension: “Project” and “Project Weeks”, I am trying to fetch the Start Week and then increment it by 1 for every column of Project Week.
I have tried this formula: 'Start Week'[ADD: 'Project Weeks']
But, it is giving me the same value of “Start Week” value for every column in each project.

Desired Outcome: For the 1st Project Week Column: it should give the “Start Week” value and for the next Project Week Column: (Start Week + 1) and for the next : (Start Week + 2) and so on…
I have tried using SHIFT('Start Week'[ADD: 'Project Weeks'],1)
but it gives Week 2, Week 28 for ABC, XYZ project respectively for every column . 
 

SHIFT operator



So basically, the values should be incremented by 1 for the subsequent columns.
Week 1, Week 2, Week 3, Week 4 and so on for ABC project
Week 27, Week 28, Week 29, Week 30 and so on… for XYZ project
Can someone help me with this?

Best answer by Chahat

Update: I have resolved this issue by applying the following formula and it’s working fine now.
SHIFT('Start Week',CEILING('Project Weeks'.Number) - 1)

2 replies

Chahat
Master Helper
Forum|alt.badge.img+14
  • Author
  • Master Helper
  • Answer
  • August 8, 2024

Update: I have resolved this issue by applying the following formula and it’s working fine now.
SHIFT('Start Week',CEILING('Project Weeks'.Number) - 1)


Stef
Employee
Forum|alt.badge.img+12
  • Employee
  • August 8, 2024

Great that you've solved it @pigment_enthusiast !