Forum Discussion

marsclone's avatar
marsclone
Helper IV
7 years ago
Solved

Week to Date Measure

Hi,

 

I'm struggling to get Week Measures to work. YTD Measures are working.

 

What am i doing wrong?

 

Test

 

Thank you for your help!

 

Regards Marcel

  • Hi,

     

     

    TotalAmount WTD = 
    CALCULATE (
        [TotalAmount],
        'Date'[Weeknumber] = WEEKNUM(TODAY()))
    Total Amount WTD LW = CALCULATE([TotalAmount], 'Date'[Weeknumber] = WEEKNUM(TODAY())-1)
    Difference = [TotalAmount WTD] - [Total Amount WTD LW]

    Have you tried these code?

     

7 Replies

  • v-xicai's avatar
    v-xicai
    Community Support

    Hi marsclone ,

     

    I am not sure what desired result would you want, could you please clarify and share the desired output screenshots for further analysis? Do mask sensitive data before uploading.

     

    Please read this post to get your answer quickly: How to Get Your Question Answered Quickly.

     

    Best Regards,

    Amy

    • marsclone's avatar
      marsclone
      Helper IV

      Hi v-xicai 

       

      Thank you for your help!

       

      In my file there are only 2 weeks of data, but what i would like to achieve, is to calculate "Week to Date" - "Last Week" and the Difference between those.

       

      It would look like

       

      BronWeek to DateLast WeekDifference
       542.774,49507.530,0935.244,40
      Location1629.853,40605.535,5924.317,81
      Location2994.774,12957.262,2237.511,90
      Location3136.540,00130.824,005.716,00
      Location4457.356,40437.482,4319.873,97
      Location51.280.081,821.228.250,9251.830,90
      Location6176.212,00176.212,000,00
      Location7107.014,0092.896,0014.118,00
      Location8200.140,90189.631,8110.509,09
      Location9721.716,89693.739,7027.977,19
      Location10105.753,74101.705,564.048,18
      Location11269.247,71251.421,3017.826,41
      Location12233.887,80190.492,5843.395,22
      Location131.127.689,641.074.360,4453.329,20
      Totaal6.983.042,916.637.344,64345.698,27

       

      Thank you!

      Regards Marcel

      • mussaenda's avatar
        mussaenda
        Community Champion

        Hi,

         

         

        TotalAmount WTD = 
        CALCULATE (
            [TotalAmount],
            'Date'[Weeknumber] = WEEKNUM(TODAY()))
        Total Amount WTD LW = CALCULATE([TotalAmount], 'Date'[Weeknumber] = WEEKNUM(TODAY())-1)
        Difference = [TotalAmount WTD] - [Total Amount WTD LW]

        Have you tried these code?