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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
afaro
Helper III
Helper III

How to get newly added/deleted rows from a table per month/year?

I have a table where it looks like this 

c1c2date
A1B110-10-24
A2B210-10-24
A3B310-10-24
A2B211-10-24
A4B411-10-24

 

So, in this example, A1-B1 and A3-B3 were removed from the table during the month of November from October 

and A4-B4 was added to the table. 

I want two tables which show me these 2 outputs. 

I use two columns to identify any unique row c1-c2. 

 

How do I go about doing this? 

 

Thank you in advance. 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @afaro ,

I create a table as you mentioned.

vyilongmsft_0-1712127911210.png

Then I create a calculated column.

Column = 'Table'[c1] & "-" & 'Table'[c2]

vyilongmsft_1-1712128194422.png

I create a measure and here is the DAX code.

Measure =
CALCULATE (
    COUNT ( 'Table'[Column] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Column]
            IN VALUES ( 'Table'[Column] )
                && 'Table'[date] = "10/10/2024"
    )
)
    - CALCULATE (
        COUNT ( 'Table'[Column] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Column]
                IN VALUES ( 'Table'[Column] )
                    && 'Table'[date] = "11/10/24"
        )
    )

vyilongmsft_2-1712128877497.png

 

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @afaro ,

I create a table as you mentioned.

vyilongmsft_0-1712127911210.png

Then I create a calculated column.

Column = 'Table'[c1] & "-" & 'Table'[c2]

vyilongmsft_1-1712128194422.png

I create a measure and here is the DAX code.

Measure =
CALCULATE (
    COUNT ( 'Table'[Column] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Column]
            IN VALUES ( 'Table'[Column] )
                && 'Table'[date] = "10/10/2024"
    )
)
    - CALCULATE (
        COUNT ( 'Table'[Column] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Column]
                IN VALUES ( 'Table'[Column] )
                    && 'Table'[date] = "11/10/24"
        )
    )

vyilongmsft_2-1712128877497.png

 

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

This works but isn't dynamic though. I wanted user to be able to choose month/year

lbendlin
Super User
Super User

Use the date as a filter.  In fact, you should have a calendar table for that.

lbendlin
Super User
Super User

Read about EXCEPT and INTERSECT.

My data is in the same table and not separate tables. 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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.