Forum Discussion
Anonymous
6 years agoNot applicable
measure
Hello, Can you help with the following please? There are three tables in model... PTable ---------- PKey PCode myDate --------- DateKey DateValue calendarDateYear CalendarQuarter StartQu...
Anonymous
6 years agoNot applicable
Hi Anonymous ,
You can create the measures with below formulas:
Measure_1 =
VAR curdate =
MAX ( 'Fact'[DateKey] )
VAR predate =
CALCULATE ( MAX ( 'Fact'[DateKey] ), 'Fact'[DateKey] < curdate )
RETURN
CALCULATE ( MAX ( 'Fact'[Price] ), 'Fact'[DateKey] = predate )Measure_2 =
CALCULATE (
MAX ( 'Fact'[Price] ),
FILTER (
ALL ( 'Fact'[DateKey] ),
RIGHT ( 'Fact'[DateKey], LEN ( 'Fact'[DateKey] ) - 4 )
= MAX ( 'QuarterDateStart'[QuarterStartDateKey] )
)
)And I created a sample pbix file, you can get it from this link.
Best Regards
Rena
Anonymous
6 years agoNot applicable
I get error in Measure_2
The syntax for ')' is incorrect. ...
- Anonymous6 years agoNot applicable
Measure_2 seems to give the same value for all the rows which is not correct
- Anonymous6 years agoNot applicable
Hi Anonymous ,
Could you please provide some screen shots about your visuals and applied measures in report? Thank you.
Best Regards
Rena