Partial Period Comparison WTD WOW

According to this Blog Post for Advanced Use Case 3: Partial Period Comparisons, is there a way to have this work with Week-over-Week?

For example, if today is August 16th 2023, and I want to compare my sales for the prior week’s week-to-date (not ALL of last week) how would that calculation look?

Looking for something that would take the total sales across August 6th through 9th vs the sales across August 13th - 16th. (I want to exclude August 10, 11, and 12 since today is Wednesday and I want to see how I’m trending compared to how I was the previous Wednesday)

"Hello Clayton_Barton !
For that type or calculation you would want to use periodOverPeriodDifference, which when using it to show on a weekly basis would look like the below example:
periodOverPeriodDifference(sum(Sales),{Order Date}, WEEK, 1)

Looking for something like this: Week to Date vs. Previous Week to Date in Tableau (WTD) — OneNumber

Think I may have found a solution

WTD Sales = ifelse(dateDiff(truncDate('WK', {date}),${Today},'WK') = 0, {Sales}, NULL)

Prior WTD Sales = ifelse(dateDiff(truncDate('WK', {date}),${Today},'WK') = 1 AND extract('WD', {date}) <= extract('WD', addDateTime(-1, 'DD', now())), {Sales}, NULL)

WoW % Diff = (sum({WTD Sales})-sum({Prior WTD Sales}))/sum({Prior WTD Sales})

Glad you found it!. I’ll mark your answer as a solution.