Forum Discussion
nlakshmi
1 year agoFrequent Visitor
Week over Week Diff
Hi, I have a question on a calculation for week-over-week change. I have the data as below: Column 1 is the Week Ending Date Date Name Origin Date Destination Date 6/30/2025 P1 ...
- 1 year ago
you can try to create three measures
Count of NameTotal = COUNTROWS('Table')Count minus Count of Name with Destination Date = [Count of NameTotal] - CALCULATE(COUNTROWS('Table'),FILTER('Table',not(ISBLANK('Table'[Destination Date]))))Measure =VAR _date = MAX('Table'[Date])VAR _list = CALCULATETABLE(VALUES('Table'[Name]),'Table'[Date] = _date)VAR _list2 = CALCULATETABLE(VALUES('Table'[Name]),FILTER(ALL('Table'),'Table'[Date] < _date))RETURN if (_date=CALCULATE(min('Table'[Date]),all('Table')),0,countrows(EXCEPT(_list, _list2))+0)pls see the attachment below
pls see the attachment below
Royel
1 year agoSuper User
Hi nlakshmi you have 2 requirements, this thiese two measure and let me know your progress.
Names_With_Destination_Count =
VAR Result =
CALCULATE(
DISTINCTCOUNT('Table'[Name]),
FILTER('Table', NOT(ISBLANK('Table'[Destination Date])))
)
RETURN
IF(ISBLANK(Result), 0, Result)
Names_With_Destination_Previous_Week =
VAR CurrentWeek = MAX('Table'[Date])
VAR PreviousWeek = CurrentWeek - 7
var result = CALCULATE(
DISTINCTCOUNT('Table'[Name]),
'Table'[Date] = PreviousWeek,
NOT(ISBLANK('Table'[Destination Date]))
)
RETURN
IF(ISBLANK(Result), 0, Result)
Output:
Find this helpful? ✔ Give a Kudo • Mark as Solution – help others too!