Forum Discussion
Anonymous
6 years agoNot applicable
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 ...
- 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"
mahoneypat
6 years agoMicrosoft Employee
Please try these two expressions for From and To. They seem to get your desired result.
From = var prevweek = Max(Terms[WeekNum])-1
return CALCULATE(MIN(Terms[Payment term]), Terms[WeekNum] = prevweek)
To = var latestweek = Max(Terms[WeekNum])
return CALCULATE(MIN(Terms[Payment term]), Terms[WeekNum] = latestweek)
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat