Forum Discussion
Anonymous
4 years agoNot applicable
Return values for the last date available
Hi everyone, I am making a report with the following tables: ProjectList Project ID Project name Project Owner 1 Project X John Doe 2 Project Y Jane Doe And Stat...
- 4 years ago
HI Anonymous
Download this file: https://gofile.io/d/A1SLih
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
smpa01
Community Champion
4 years agoAnonymous returned and attached
Measure =
VAR _0 =
MAX ( 'Project Status'[Created] )
RETURN
CALCULATE (
MAX ( 'Project Status'[Status Budget] ),
FILTER (
VALUES ( 'Project Status' ),
'Project Status'[Created]
= CALCULATE ( _0, ALLEXCEPT ( 'Project Status', 'Project Status'[ProjectId] ) )
)
)
AlexisOlson thanks !!!
- AlexisOlson4 years ago
Super User
Not quite what I meant. Once a variable is defined, adjusting its filter context with CALCULATE doesn't do anything, so your DAX is equivalent to
Measure = VAR _0 = MAX ( 'Project Status'[Created] ) RETURN CALCULATE ( MAX ( 'Project Status'[Status Budget] ), FILTER ( VALUES ( 'Project Status' ), 'Project Status'[Created] = _0 ) )I was suggesting something like this:
Measure = VAR ProjectLastCreated = CALCULATE ( MAX ( 'Project Status'[Created] ), ALLEXCEPT ( 'Project Status', 'Project Status'[ProjectId] ) ) RETURN CALCULATE ( MAX ( 'Project Status'[Status Budget] ), 'Project Status'[Created] = ProjectLastCreated )