Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Remove incomplete week

Hi there,

 

I am plotting a weekly line chart with daily data. I am trying to not show the latest week's data point if the week is incomplete. 

 

My current solution does not work

Adm WK CY = 
VAR x = year( LASTDATE( MAIN_COR[DATE]))
VAR z = WEEKNUM( LASTDATE(MTDdate[Date]), 1)

Return 
CALCULATE( sum( MAIN_COR[ADM]),MAIN_COR[Attribute] = "Actual", MAIN_COR[Year] = x, MAIN_COR[Wkno] < z)

However, if I replace "z" with the current week number itself, "12", it works.

Where am I going wrong here?

4 Replies

  • vanessafvg's avatar
    vanessafvg
    Community Champion

    Anonymous   have you returned(printed) all your variables to test  you are getting what you expecting?

    • Anonymous's avatar
      Anonymous
      Not applicable

      vanessafvg Yes if I return the variable z, it gives me "12", the current week number.

      • vanessafvg's avatar
        vanessafvg
        Community Champion

        Anonymous  any chance you can share your pbix?