Forum Discussion
Get value from one month ago
Yes, I tried that. Please see my response in the previous message.
To clarify, I want to display a single value from last month without the need for a slicer or selecting a row. When I use the card visualization, the value shows up as Blank. Only when I highlight a row in my table will the card show a value. I want my card to display last month's value of 52 for YourMeasure without having to click on 12/31/17 in the table.
In October, wieke ased the same question and there was no complete solution (even though it says Solved)
https://community.powerbi.com/t5/Desktop/Previous-month-value/m-p/266898/highlight/true#M120382
- Phil_Seamark8 years ago
Microsoft Employee
So just to clarify, you want the KPI that is showing as (blank) to show the latest value when nothing is selected, otherwise when a selection has been made, it's currently working perfectly?
- Phil_Seamark8 years ago
Microsoft Employee
This 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)- WolfBiber8 years ago
Microsoft Employee
Hey, you can use Filter with calculate an Today() function. Try the following expression:
LastMonth = CALCULATE([TheMeasure];Table1;month(Table1[Month])=MONTH(TODAY()))
Where TheMeasure is the same I posted:
TheMeasure = CALCULATE(SUM(Table1[Actual]); PREVIOUSMONTH(Table1[Month]))
Greetings,
Wolf