Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Filter not working as expected

  Hi all. Iniatially posted this in the Dsktop section but wonder if it better fits here   I am trying to caculate the variance period on period per customer. My Period value is in table date My...
  • sturlaws's avatar
    6 years ago

    hi, Anonymous ,

     

    could you try to wrap an ALL() around 'Date Lookup' inside the filter, like this:

    Value2 =
    VAR periodvalue =
        VALUE ( SELECTEDVALUE ( 'Date LookUp'[Financial Period] ) )
    RETURN
        CALCULATE (
            SUM ( 'Sales Invoice History'[STG_Gross_Profit_Less_BDM] ),
            FILTER (
                ALL ( 'Date LookUp' ),
                'Date LookUp'[Financial Period] = periodvalue + 1
            )
        )

     

    Cheers,
    Sturla

    If this post helps, then please consider Accepting it as the solution. Kudos are nice too.