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 have the following Calculated column to figure out if which rows hold the latest versions of data
MaxDate = CALCULATE(MAX(ProjectsTable[Metric Date]),FILTER(ProjectsTable, Projects[Project Name]=EARLIER(ProjectsProject Name])))
Followed by this second calculated column which acts as a Flag
LatestValue = If(ProjectTable[Metric Date] = ProjectTable[MaxDate], 1, 0)
Ultimately I'm trying to fit both of these inside a Measure as variables so the result can be dynamically filtered.
My problem is that the first column is a formula that doesn't work inside a measure. I'm getting errors with it.
I tried playing around with it with something like this but to no avail
Var FilterDate = MAX(ProjectTable'[Metric Date])
Var LastUpdate =
CALCULATE(
IF(MAX(Project Table[Metric Date]) <= FilterDate, 1, 0), VALUES(ProjectTable[Project Name]))Note, the VALUES is because I need to filter latest date per Project name (different projects have different latest dates).
Thanks for any help!
Solved! Go to Solution.
To transform your calculated columns into a measure, you need to adjust your DAX code to handle row context within a measure. Here's how you can create a measure that identifies the latest version of data dynamically:
LatestValueMeasure =
VAR MaxDatePerProject =
CALCULATE(
MAX(ProjectsTable[Metric Date]),
ALLEXCEPT(ProjectsTable, ProjectsTable[Project Name])
)
RETURN
IF(
MAX(ProjectsTable[Metric Date]) = MaxDatePerProject,
1,
0
)
To transform your calculated columns into a measure, you need to adjust your DAX code to handle row context within a measure. Here's how you can create a measure that identifies the latest version of data dynamically:
LatestValueMeasure =
VAR MaxDatePerProject =
CALCULATE(
MAX(ProjectsTable[Metric Date]),
ALLEXCEPT(ProjectsTable, ProjectsTable[Project Name])
)
RETURN
IF(
MAX(ProjectsTable[Metric Date]) = MaxDatePerProject,
1,
0
)
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!
| User | Count |
|---|---|
| 9 | |
| 9 | |
| 8 | |
| 6 | |
| 6 |
| User | Count |
|---|---|
| 24 | |
| 20 | |
| 20 | |
| 14 | |
| 14 |