The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi,
I am hoping someone can help I have a very simple table.
I would like to be able to create a measure that would provide the figure (total) for the second last date available in my data. So, in this scenario 400. Any ideas?
Date Total
1/1/2020 100
2/1/2020 150
3/1/2020 400
4/1/2020 500
Thanks,
Boycie92
Solved! Go to Solution.
measure =
var _max= maxx(allselected(Table),Table[date])
return
calculate(lastnonblankvalue(Table[date],Sum(Table[Total])),Table[Date]<_max)
OR
measure =
var _max= maxx(allselected(Table),Table[date])
return
calculate(lastnonblankvalue(Table[date],Sum(Table[Total])),filter(allselected(Table),Table[Date]<_max))
measure =
var _max= maxx(allselected(Table),Table[date])
return
calculate(lastnonblankvalue(Table[date],Sum(Table[Total])),Table[Date]<_max)
OR
measure =
var _max= maxx(allselected(Table),Table[date])
return
calculate(lastnonblankvalue(Table[date],Sum(Table[Total])),filter(allselected(Table),Table[Date]<_max))
Hi @amitchandak
That works perfectly thank yo so much. Is there anyway to display the second las date as a seperate messure?
Thanks,
Boycie92
@Boycie92 , Create a measure in the same way as the last one and in that use
max(Table[Date]) in place of Sum(Table[Total])
@Boycie92
Please check this solution,
https://community.powerbi.com/t5/Desktop/Show-second-last-date-value-in-card/td-p/531093
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
78 | |
71 | |
52 | |
50 |
User | Count |
---|---|
123 | |
119 | |
76 | |
64 | |
60 |