Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

WTD Measure

Hi, I am trying to display week to date sales on the card visualization. I do have a date table and have columns verifying the number of the day of the week (Sunday =0, Monday = 1, etc). I even created Start of the Week and End of the Week calculated columns. I've seen quite a few topics on how to achieve this, but nothing is working. I can get the totals if I use a Table, but I just want to capture that WTD number on a card and it update everyday without a filter applies. Any help would be appreciated. Thanks!

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Below is my test data.

    I created a calculated column as yearweek and a measure to calculate today's yearweek.

    Then i create another measure to calculate the sum of values which yearweek equals to today's yearweek.

    today = FORMAT(TODAY(),"YYYYWW")
    Measure = CALCULATE(SUM('Table'[value]),FILTER('Table','Table'[yearweek]=[today]))

     

    Best Regards,

    Jay

     

    Community Support Team _ Jay Wang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    • Anonymous's avatar
      Anonymous
      Not applicable
      Thank you Jay! I actually got my DAX code to work. Thank you for your help.
      • Anonymous's avatar
        Anonymous
        Not applicable

        Anonymous  Hi Jay, I've ran across a hiccup with the Dax Code I was using, due to budget forcast updates that it pushes the dates out and I was using LASTDATE, so I was getting a zero for my WTD Sales. 

        So, I was trying what you suggested, however my YearWeek is showing the same value instead of it changing when it gets to the new week start to week end. Any suggestions? The value in the Actual column for example Start of Week May 3, 2020 to End of Week May 9, 2020 is what I'm trying to display on my visulation card and would like it to update everyday when the data refreshes. Thanks for your help!