Forum Discussion

Jpahl2033's avatar
Jpahl2033
Helper I
4 years ago
Solved

Weekly Sales & Previous Week Sales Measure Not Filtering in Table

Hi,   I have two measures going for Sales this week & Sales previous week. When i try to a slicer or use a filter for these items they do not change. They are the aggregate values still.  Can someo...
  • SpartaBI's avatar
    4 years ago

    Jpahl2033 try first to replace the ALL('Table1') with ALL('Table1'[WeekRank])
    Also use variables, but in this case that wasn't the issue, so write this: 


    Sales This Week = 
    VAR _current_week = MAX('Table1'[WeekRank])
    RETURN
    CALCULATE(SUM('Table1'[OrderedProductSales]),FILTER(ALL('Table1'[WeekRank]'),'Table1'[WeekRank] =_current_week))
     
    Sales Last Week = 
    VAR _current_week = MAX('Table1'[WeekRank])
    RETURN
    CALCULATE
    (SUM('Table1'[OrderedProductSales]),FILTER(ALL(Table1'[WeekRank]),'Table1'[WeekRank] = _current_week  -1 ))


    In case it answered your question please mark this as a solution for community visibility. Appreciate Your Kudos 🙂