Forum Discussion
Measure Adding
- 1 year ago
Hi Khomotjo ,
The issue with your measure arises because FILTER(ALL(Orders), (TRUNC(Orders[Finalised Date])=Analyse)) removes all filters from the table, causing unintended cumulative calculations across prior dates. The ALL(Orders) function removes any filters applied, leading to an incorrect multiplication effect.
To fix this, replace ALL(Orders) with ALLSELECTED(Orders), which retains the relevant filters while applying the condition correctly. This ensures that the measure calculates SUM(Orders[Product Count]) only for the intended Finalised Date without accumulating values across prior dates.
Picked_Lines = VAR Analyse = MAX(Orders[Date]) RETURN CALCULATE( SUM(Orders[Product Count]), FILTER(ALLSELECTED(Orders), TRUNC(Orders[Finalised Date]) = Analyse) ) )By making this change, the measure will now properly return the expected values without multiplying them across previous dates. If the issue persists, consider checking if any additional filters or relationships in your data model are affecting the results.
Best regards,
Hi Khomotjo ,
The issue with your measure arises because FILTER(ALL(Orders), (TRUNC(Orders[Finalised Date])=Analyse)) removes all filters from the table, causing unintended cumulative calculations across prior dates. The ALL(Orders) function removes any filters applied, leading to an incorrect multiplication effect.
To fix this, replace ALL(Orders) with ALLSELECTED(Orders), which retains the relevant filters while applying the condition correctly. This ensures that the measure calculates SUM(Orders[Product Count]) only for the intended Finalised Date without accumulating values across prior dates.
Picked_Lines =
VAR Analyse = MAX(Orders[Date])
RETURN
CALCULATE(
SUM(Orders[Product Count]),
FILTER(ALLSELECTED(Orders), TRUNC(Orders[Finalised Date]) = Analyse)
)
)
By making this change, the measure will now properly return the expected values without multiplying them across previous dates. If the issue persists, consider checking if any additional filters or relationships in your data model are affecting the results.
Best regards,