Forum Discussion
for loops to generate a dataframe
yes here is the problem I have.
The starting dataset is a 3 column table: 'date', 'simulation number', 'value'.
I have a measure which perform an operation over the value column filtering for sim number, so for each sim number I compute this operation (which is time granulation sensitive).
The measure is the following:
_AP = VAR j = SELECTEDVALUE(IndexTable[Value])
RETURN
SUMX(
maybe_right,
CALCULATE(
SUMX(maybe_right, maybe_right[capacity]*maybe_right[price])/[_sum_cf], FILTER(ALLEXCEPT(maybe_right, maybe_right[Date]), maybe_right[simulation] = j
)
))
The nest phase would be to compute the quantile (worst 1%, 5% ecc) for those results and my idea was to add the results of the measure to a new table in which each column is one simulation.
Actually I menaged to do it but the problem is that it is not time sensitive anymore (which it makes sense!), so I was trying to find a way to do it all in one measure: compute the reaults for each index and directly compute the quantile and plot it.
I hope I have been clear.
Thank you