Forum Discussion
PBI-IK
6 years agoFrequent Visitor
Previous Value on the same table
Hi i have this table : I used this formula to take the previous row previous = CALCULATE( SUM('Fact Risk Decision Flow'[grd_granted_amount_value_euro]); TOPN(1; FILTER( ALLSELEC...
Anonymous
6 years agoNot applicable
// This should be the basic measure.
[Total Value] = SUM ( 'Fact Risk Decision Flow'[grd_granted_amount_value_euro] )
// PP = previous period
// Periods should have their own dedicated dimension.
// No slicing on fact tables should ever be performed.
// All columns in fact tables must be hidden. Only
// dimensions should be exposed and used for slicing.
[PP Value] =
var __onePeriodVisible = HASONEVALUE( Periods[Period] )
var __period = selectedvalue( Periods[Period] )
var __prevPeriod = __period - 1
var __result =
CALCULATE
[Total Value],
Periods[Period] = __prevPeriod,
REMOVEFILTERS( Periods )
)
return
if( __onePeriodVisible, __result )
Best
D
PBI-IK
6 years agoFrequent Visitor
Thanks for your reply but it's not exactly the solution that i need 😉
Indeed the period could be 2 years ago and not only -1.
I'm using SSAS 2016 so, REMOVEFILTERS and SELECTEDVALUES not works but i replace it with equivalent formula.
Thank you by advance
- Anonymous6 years agoNot applicableHi PBI-IK.
if you want to get the solution you're after, you have to do a bit more upfront work. Please define your problem more clearly and show all the involved structures.
Best
D