Forum Discussion

8 Replies

  • Anonymous , have you tried measures like these with or without help from date table

     

    example

    Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <=max(date[Date])))
    Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(Sales),Sales[Sales Date] <=max(Sales[Sales Date])))

     

    also you can try quick measure

    • Anonymous's avatar
      Anonymous
      Not applicable

      Of course  i tried this 

      Cumulative EW =
      CALCULATE([EW], FILTER (
      ALLSELECTED ( 'Date' ),
      'Date'[Date] <= MAX ( 'Date'[Date] ) ))
       
      But not working.
  • You don't need to force the context transition, you have to break it!
    First create a calculated column:

     

    BreakContextTransitionTable = 
    VAR __YMTable = SUMMARIZE(ALL('Date'), 'Date'[MonthnYear])
    VAR __YMTableEW = ADDCOLUMNS(__YMTable, "@EW", [EW])
    RETURN
    __YMTableEW

     

    Then add this measure:

     

    EW = 
    VAR __filter = FILTER(BreakContextTransitionTable, BreakContextTransitionTable[MonthnYear] <= MAX('Date'[MonthnYear]))
    RETURN
    SUMX(__filter, BreakContextTransitionTable[@EW])

     

    Giving this result:

    Of course you can break the context transition by rewriting the EW measure (removing all Calculate())

  • You don't need to force the context transition, you have to break it!
    First create a calculated column:

     

    BreakContextTransitionTable = 
    VAR __YMTable = SUMMARIZE(ALL('Date'), 'Date'[MonthnYear])
    VAR __YMTableEW = ADDCOLUMNS(__YMTable, "@EW", [EW])
    RETURN
    __YMTableEW

     

    Then add this measure:

     

    **bleep** EW = 
    VAR __filter = FILTER(BreakContextTransitionTable, BreakContextTransitionTable[MonthnYear] <= MAX('Date'[MonthnYear]))
    RETURN
    SUMX(__filter, BreakContextTransitionTable[@EW])

     

    Giving this result:

    Of course you can break the context transition by rewriting the EW measure (removing all Calculate())

    • Anonymous's avatar
      Anonymous
      Not applicable

      Could you please attach pbix as well?

       

      "First create a calculated column:" - You mean calculated table? Is there a way without creating calculated table?

       

      "Of course you can break the context transition by rewriting the EW measure (removing all Calculate())" - I didnt understand this, would you be so kind to explain this a bit?