Join 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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I need to identify which row of data was the last (END_DATE) in each month by IMPORT_CODE. I would like to simply return on those rows the words "LAST" to allow me to use/filter the data for only those with the last data point. End of Month and Days from last date I added but this seems inefficient.
Solved! Go to Solution.
Hi @blpaxson ,
You can create two calculated columns as below to get it:
YearMonth = FORMAT('Table'[END_DATE],"YYYYMM")Column =
VAR _maxdate =
CALCULATE (
MAX ( 'Table'[END_DATE] ),
FILTER (
'Table',
'Table'[YearMonth] = EARLIER ( 'Table'[YearMonth] )
&& 'Table'[IMPORT_CODE] = EARLIER ( 'Table'[IMPORT_CODE] )
)
)
RETURN
IF ( 'Table'[END_DATE] = _maxdate, "LAST" )
Best Regards
Hi @blpaxson ,
You can create two calculated columns as below to get it:
YearMonth = FORMAT('Table'[END_DATE],"YYYYMM")Column =
VAR _maxdate =
CALCULATE (
MAX ( 'Table'[END_DATE] ),
FILTER (
'Table',
'Table'[YearMonth] = EARLIER ( 'Table'[YearMonth] )
&& 'Table'[IMPORT_CODE] = EARLIER ( 'Table'[IMPORT_CODE] )
)
)
RETURN
IF ( 'Table'[END_DATE] = _maxdate, "LAST" )
Best Regards
@blpaxson , Based on what I got these blogs should help
Latest Date
https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0
Power BI Get the Last/Latest Value of a Category: https://www.youtube.com/watch?v=W4EF1f_k6iY
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!