Forum Discussion
JuhoP
8 years agoNew Member
Calculate dynamic measure based on slicer selection
Hi Everyone, I am total newbie for Power BI, just couple of days hands on. I have a problem that I have not been able to solve till now and I was wondering if you could help me? I have used a...
- 8 years ago
Hi JuhoP,
Could you try the formula below to see if it works? :smileyhappy:
Metrics1 = VAR s = [Selected] RETURN ABS ( CALCULATE ( MAX ( 'FactTable'[Value] ); 'DimensionTable'[Column] = s; LASTDATE ( 'Dimension Date'[Calendar_Date] ) ) / ( CALCULATE ( MIN ( 'FactTable'[Value] ); 'DimensionTable'[Column] = s; ALLSELECTED ( 'Dimension Date'[Calendar_Date] ) ) ) - 1 )Regards
v-ljerr-msft
Microsoft Employee
8 years agoHi JuhoP,
Could you try the formula below to see if it works? :smileyhappy:
Metrics1 =
VAR s = [Selected]
RETURN
ABS (
CALCULATE (
MAX ( 'FactTable'[Value] );
'DimensionTable'[Column] = s;
LASTDATE ( 'Dimension Date'[Calendar_Date] )
)
/ (
CALCULATE (
MIN ( 'FactTable'[Value] );
'DimensionTable'[Column] = s;
ALLSELECTED ( 'Dimension Date'[Calendar_Date] )
)
)
- 1
)
Regards
JuhoP
8 years agoNew Member
Hi!
Yes, it works beatifully! Thanks a million!