Forum Discussion
GraceN
8 years agoFrequent Visitor
Get value from one month ago
Hi! I am new to Power BI, and I want to create a measure that returns a value corresponding to the previous month. I don't want to use a slicer. I think I want to use the CALCULATE function, but I do...
Phil_Seamark
Microsoft Employee
8 years agoThis might be getting close (with a few tweaks to suit)
YourMeasure =
VAR LastDateWithalue = CALCULATE(LASTDATE('Table1'[Month]),'Table1'[Actual]<>BLANK())
VAR LatestValue = CALCULATE(SUM('Table1'[Actual]),'Table1'[Month] = LastDateWithalue)
RETURN
IF(HASONEVALUE('Table1'[Month]),
CALCULATE(
SUM(Table1[Actual]),
PREVIOUSMONTH(Table1[Month])
)
, LatestValue)GraceN
8 years agoFrequent Visitor
Hi Phil:
Thanks for your answer, but similar to srivint's measure, it only works for the Actual Last Month measure and not the Target Last Month measure. The Target column contains values to June 2018, and your measure returns a value of 90 rather than 55