Forum Discussion
Kazu
Helper II
11 months agoDuplicate, shift, then aggregate
Suppose there is Base Table like below I would like an output table like the left side of below. Repeat and Offset are variables or could be parameters in Power BI. Not sure "Offset" is the ...
- 11 months ago
Hi Kazu,
By utilizing the DAX function GENERATE along with a parameter table or offset table, you can dynamically control the offset value. Please use the following DAX as a calculated table to achieve the desired outcome.
OutputTable =
GENERATE(
'Base',
ADDCOLUMNS(
'OffsetTable',
"ShiftedIndex", 'Base'[Index] + 'OffsetTable'[OffsetValue],
"ShiftedValue", 'Base'[Value]
)
)Thank you.
djurecic
Super User
11 months agoHi Kazu ,
You are on the right track with OFFSET. Here is a video with more information:
https://www.youtube.com/watch?v=BRZrC3stCEQ
Kazu
Helper II
11 months agoThanks. I am trying OFFSET and I feel it would work if the number of repeat in my example is fixed but not if variable.