Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Week over Week change for the same document

Hello guys!   I have a table called "OPEN POs" that looks like this:   WeekNum Supplier PO number Payment term 33 A 158 30 days 33 C 105 60 days 33 Y 469 30 days 33 A ...
  • lbendlin's avatar
    6 years ago

    What should happen in week number 1 ?

     

    Anyway.  Add two calculated columns  (measures are not required here as there is no filter impact)

     

    Last Week = 
    var p='OPEN POs'[PO number]
    var s='OPEN POs'[Supplier]
    var w='OPEN POs'[WeekNum]
    return calculate(max('OPEN POs'[Payment term]),all('OPEN POs'),'OPEN POs'[PO number]=p,'OPEN POs'[Supplier]=s,'OPEN POs'[WeekNum]=w-1)
    
    Different = SWITCH(TRUE(),ISBLANK('OPEN POs'[Last Week]),"no",[Last Week]='OPEN POs'[Payment term],"no","yes")

     

    Then filter your table to Different="yes"