Forum Discussion
Measure does not total and disappears values
- 7 years ago
Hi AlejandroPCar,
If 73 is the right answer, please try to wrap the MIN part with "calculate".
Actividades Adultos Inmediato 2 = VAR adult = SUMX ( VALUES ( Adult_Quindio[id_persona] ), CALCULATE ( SUM ( Jerarquia_Adult[cantidad] ), FILTER ( Jerarquia_Adult, AND ( CALCULATE ( MIN ( Adult_Quindio[annodec] ) ) >= Jerarquia_Adult[edadinicial], CALCULATE ( MIN ( Adult_Quindio[annodec] ) ) < Jerarquia_Adult[edadfinal] ) ) ) ) RETURN adult
BTW, maybe you can establish a *:* relationship to avoid a new table. But this is a suggestion based on the heavily truncated data.
Best Regards,
Hi! v-jiascu-msft
Wow, your explanation was incredibly useful. So... all the time the problem was the MIN... I am looking for a filter like "the value of the row 1 in the column A in the Table A is greater than the value of the row 1 in the column A in the Table B ". But, my question is now, to avoid MIN... How can I filter columns from two different tables in one FILTER?
Something like...
CALCULATE( [Measure], FILTER( (Tables), TableA[Value] > TableB[Value]
)
)
I believed that MIN just give the value of that selected row. Well thats true when a single row is filtered, but... what a mistake.
Thanks again...
And, I know it... all data I publish here is already heavy truncated.
Hi AlejandroPCar,
If 73 is the right answer, please try to wrap the MIN part with "calculate".
Actividades Adultos Inmediato 2 = VAR adult = SUMX ( VALUES ( Adult_Quindio[id_persona] ), CALCULATE ( SUM ( Jerarquia_Adult[cantidad] ), FILTER ( Jerarquia_Adult, AND ( CALCULATE ( MIN ( Adult_Quindio[annodec] ) ) >= Jerarquia_Adult[edadinicial], CALCULATE ( MIN ( Adult_Quindio[annodec] ) ) < Jerarquia_Adult[edadfinal] ) ) ) ) RETURN adult
BTW, maybe you can establish a *:* relationship to avoid a new table. But this is a suggestion based on the heavily truncated data.
Best Regards,
- AlejandroPCar7 years ago
Helper IV
Amazing. Can you explain the reasson of put MIN in a CALCULATE?
- v-jiascu-msft7 years ago
Microsoft Employee
Hi AlejandroPCar,
Usually, calculate-function-dax is used to alter the current context. It also can convert a Row context to the Filter context in which the MIN can evaluate row by row.
Best Regards,