Forum Discussion
Sasha
Helper III
8 years agoA diff between a measure and its implicit definition
Hi, As an example I have a table with Runs details where each row has a date, the number of a run and a specific km with its time. I also have a measure Best_1_km = MIN(RunsDetails[Time]) showing t...
- 8 years ago
Actually MEASURE transforms a ROW context into Filter Context
https://www.sqlbi.com/articles/understanding-context-transition/So in your case the MEASURE [Best_1_km] gets evlauated differently for every row of the RunsDetails Table
If you store the MEASURE first in a variable and then apply this formula,, it will workDate_Best_1_km = VAR mybest = [Best_1_km] RETURN CALCULATE ( MIN ( RunsDetails[Date] ), FILTER ( RunsDetails, RunsDetails[Time] = mybest ) )
Zubair_Muhammad
Community Champion
8 years ago
Actually MEASURE transforms a ROW context into Filter Context
https://www.sqlbi.com/articles/understanding-context-transition/
So in your case the MEASURE [Best_1_km] gets evlauated differently for every row of the RunsDetails Table
If you store the MEASURE first in a variable and then apply this formula,, it will work
Date_Best_1_km =
VAR mybest = [Best_1_km]
RETURN
CALCULATE (
MIN ( RunsDetails[Date] ),
FILTER ( RunsDetails, RunsDetails[Time] = mybest )
)
Sasha
Helper III
8 years agoThank you!
So there shouldn't be an issue with the second version I've wrote?