Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hello experts,
I want to display the value for maximum year.
For example, the maximum year will be the latest year which is 2022, so the values should only display data for year 2022. But there are few values from year 2020 also have been displayed which is not correct.
My formula looks like below.. Need your help & insights on this..
Hi @Anonymous ,
You can try this code to create a measure.
Value in Max Year =
VAR _latestYear =
YEAR ( MAXX ( ALL ( 'table' ), 'table'[date] ) )
VAR _valueX =
CALCULATE (
SUM ( 'table'[Value] ) / 1000,
FILTER (
'table',
AND ( table[category] = "pink", YEAR ( 'table'[date] ) = _latestYear )
)
)
RETURN
_valueX
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , Try a measure like (With help from a separate date table
var latestYear = YEAR(MAX('table'[date]))
CALCULATE(SUM('table'[Value])/1000, table[category]= "pink",
filter(all('Date') , YEAR('Date'[date])=latestYear) )
refer
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s
Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
81 | |
42 | |
30 | |
27 | |
27 |