Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
nlakshmi
Frequent 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

 

DateNameOrigin DateDestination Date
6/30/2025P16/30/2025 
6/30/2025P27/1/2025 
6/30/2025P36/5/2025 
6/30/2025P45/15/2025 
6/30/2025P56/12/2025 
7/7/2025P16/30/20257/1/2025
7/7/2025P27/1/2025 
7/7/2025P36/5/2025 
7/7/2025P45/15/20257/1/2025
7/7/2025P56/12/2025 
7/14/2025P16/30/20257/1/2025
7/14/2025P27/1/2025 
7/14/2025P36/5/20257/2/2025
7/14/2025P45/15/20257/1/2025
7/14/2025P56/12/2025 
7/14/2025P67/3/2025 
7/21/2025P16/30/20257/1/2025
7/21/2025P27/1/2025 
7/21/2025P36/5/20257/2/2025
7/21/2025P45/15/20257/1/2025
7/21/2025P56/12/20257/4/2025
7/21/2025P67/3/2025 
7/21/2025P77/4/2025 

 

I want a generate a matrix for:

1. The count of Name that have a Destination Date week-over-week by Week Ending Date

2. The count of Name that have gotten added over previous week, like P7 got added to the week of 7/21 but was not in the 7/14.

 

Here is the result I need:

DateCount of NameTotal Count minus Count of Name with Destination DateCount of New "Name" - Week over Week
6/30/202555 - 0 = 50
7/7/202555 - 2 = 30
7/14/202566 - 3 = 31 (P6)
7/21/202577 - 4 = 31 (P7)

 

Thanks in advance.

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@nlakshmi 

 

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)


11.png
 

pls see the attachment below

 

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

6 REPLIES 6
v-tejrama
Community Support
Community Support

Hi @nlakshmi ,

 

Thank you @Royel  and @ryan_mayu  for the response provided!
Has your issue been resolved? If the response provided by the community member addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.


Thank you for your understanding!

ryan_mayu
Super User
Super User

@nlakshmi 

 

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)


11.png
 

pls see the attachment below

 

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thank you very much! This worked.

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Royel
Solution Sage
Solution Sage

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: 

Royel_0-1753214842467.png

Find this helpful? ✔ Give a Kudo • Mark as Solution – help others too!

@Royel Thank you for you response. but this is what I needed:

 

DateCount of NameTotal Count minus Count of Name with Destination DateCount of New "Name" - Week over Week
6/30/202555 - 0 = 50
7/7/202555 - 2 = 30
7/14/202566 - 3 = 31 (P6)
7/21/202577 - 4 = 31 (P7)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.