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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
hprose
Helper I
Helper I

Present in previous week but missing in current week

Hi all,

 

I have data roughly in the below format. For each week, I want to get the count of IDs that were present in the previous week but are missing in the current week. In the example below, April 14th - 2 (IDs 2 and 4 are missing), April 21st - 1 (ID 5 is missing). I want to create a chart with this week over week numbers.

 

idWeek
14/7/2023
24/7/2023
34/7/2023
44/7/2023
14/14/2023
34/14/2023
54/14/2023
64/14/2023
14/21/2023
34/21/2023
64/21/2023

 

Please let me know how I can go about it. Note that I have other columns in the table and may need to apply some filters in the formula like name = "xyz" while doing this calculation.

 

Thank you!

1 ACCEPTED SOLUTION
ThxAlot
Super User
Super User

Missing = 
VAR __wk = MAX( STAT[week] )
RETURN
    TOCSV(
        EXCEPT(
            CALCULATETABLE( VALUES( STAT[id] ), STAT[week] = __wk - 7 ),
            VALUES( STAT[id] )
        ),
        ,
        ,
        FALSE()
    )

ThxAlot_0-1683152921751.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank you for your help @Ashish_Mathur !

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
ThxAlot
Super User
Super User

Missing = 
VAR __wk = MAX( STAT[week] )
RETURN
    TOCSV(
        EXCEPT(
            CALCULATETABLE( VALUES( STAT[id] ), STAT[week] = __wk - 7 ),
            VALUES( STAT[id] )
        ),
        ,
        ,
        FALSE()
    )

ThxAlot_0-1683152921751.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



Thank you @ThxAlot ! I used COUNTROWS instead of TOCSV to get the count instead of the list. Appreciate your help!

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.