Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Get data from filter for measure

 
 

hi everyone, i need your help with this dynamic filter that i cant seem to find a solution for...

how do i get the difference of the quantity between the 2 period that i selected from the filter? the quantity is the one in millions btw. thanks in advance! would really appreciate it 

 

 

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,

    Try this measure!

     

    Measure = 
    VAR MaxDate = MAX('Date'[Date])
    Var MinDate = MIN('Date'[Date])
    Return
    CALCULATE(
        DATEDIFF(MinDate,MaxDate,DAY),
        Products    
    )

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Actually, I think Allselected() would probably be a better filter than the table name.

       

      Hope that helps you!

       

      ~Kim 

  • stevedep's avatar
    stevedep
    Icon for Memorable Member rankMemorable Member

    You are probably looking for a slightly different version:

    Measure =
    VAR MaxDate = MAX(ALLSELECTED ('Date'[Date]))
    Var MinDate = MIN(ALLSELECTED ('Date'[Date]))
    Return
    CALCULATE( [your original measure], filter (all(date), date > mindate && date < maxdate))