Forum Discussion

Ben1981's avatar
Ben1981
Helper III
2 years ago
Solved

Calculate value from a previous date

Hi, I'm trying to write a measure to calculate the volume from a table but for the previous week selected in the filter. So the user can select the current week but the measure will show what is i...
  • bhanu_gautam's avatar
    2 years ago

    Ben1981 , Try using below mentioned method

     

    VolumePreviousWeek =
    VAR SelectedWeek = SELECTEDVALUE('DateTable'[Week]) - 7
    RETURN
    CALCULATE(
    COUNT('YourTableName'[ID]),
    FILTER(
    ALL('DateTable'),
    'DateTable'[Week] = SelectedWeek
    )
    )

     

    Please accept as solution and give kudos if it helps