Forum Discussion

Victor_Oliveira's avatar
Victor_Oliveira
New Member
1 year ago
Solved

Filtering accumulated measures with dates

Hi!

I´m having trouble with the measure below

 

CALCULATE(
    DISTINCTCOUNT('Base Geral'[Codigo]), 
    'Base Geral'[Status] = "Concluído", 
    'Base Geral'[IO] = -1,
    FILTER(
        ALL('calendario'[Date]),
        'calendario'[Date] <= MAX('calendario'[Date])
    )
)

 

 
The objective is to have an accumulated ammount throughout time, but I want to be able to filter dates and not modify the result.
for example:


If I alter the date period the results change



how can I change my measure so that my date filter alters the period on the visual but doesn´t alter the result on my measure?

 




 

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Victor_Oliveira 

     

    Your measure should be correct, and at least in my simple test, it worked.
    Make sure your date slicer is using 'calendario'[Date], not 'Base Geral'[Date].

     

    Best Regards,
    Jarvis Tang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

3 Replies

  • Hey Victor_Oliveira 

    Maybe you can use ALLSELECTED instead of ALL to keep date filters. This theoretically allows the accumulation while respecting date filters from slicers.

    Acumulado =
    CALCULATE(
    DISTINCTCOUNT('Base Geral'[Codigo]),
    'Base Geral'[Status] = "Concluído",
    'Base Geral'[IO] = -1,
    FILTER(
    ALLSELECTED('calendario'[Date]),
    'calendario'[Date] <= MAX('calendario'[Date])
    )
    )

  • Hi,

    Cannot understand your requirement.  Share the download link of the file and show the expected result.  Please ensure that table/column names are in English.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Victor_Oliveira 

     

    Your measure should be correct, and at least in my simple test, it worked.
    Make sure your date slicer is using 'calendario'[Date], not 'Base Geral'[Date].

     

    Best Regards,
    Jarvis Tang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.