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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi, I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
I tried to show latest date sales per each country, and each country shows different latest date. And I tried to use TREATAS DAX function in the measure.
TREATAS function - DAX | Microsoft Learn
Last date sales: =
VAR _periodselect =
MAX ( 'calendar'[Date] )
VAR _t =
SUMMARIZECOLUMNS (
country[country],
'calendar'[Date],
FILTER ( ALL ( 'calendar' ), 'calendar'[Date] <= _periodselect ),
"@sales", SUM ( fact_table[sales] )
)
VAR _latestdate =
ADDCOLUMNS (
_t,
"@latestdate",
MAXX (
FILTER ( _t, country[country] = EARLIER ( country[country] ) ),
'calendar'[Date]
)
)
VAR _treatas =
SUMMARIZE ( _latestdate, country[country], [@latestdate] )
RETURN
CALCULATE (
SUM ( fact_table[sales] ),
TREATAS ( _treatas, country[country], 'calendar'[Date] )
)