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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
dadelta
Frequent Visitor

Find unmatched records within 1 table with different months

Hi,

I am working with 1 table in Power Query/Power BI.  This table contains 4 columns, 2 of which are a date column (last day of each month) and a unique ID column.  There are between 125,000 and 150,000 rows per month.  This table is going to be used to summarize the current months data and I need to get a count/list of items that appeared in the prior month but do not appear in the current month.  I'm able to do this in Power Query in Excel but I have 1 file for each month (essentially 2 tables).  Importing separate tables for each month is not really feasable.

How can I use the 1 table to find items where there is no match in the current month compared to the prior month?

Always appreciative of any assistance.

Thank you

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @dadelta ,

 

This table needs to contain data for this month and last month.

For example:

vjaywmsft_0-1657174236886.png

Then you could create a new table like below:

Table 2 = 
var this_month = CALCULATETABLE(VALUES('Table'[id]),FILTER('Table',MONTH('Table'[month end]) = MONTH(MAX('Table'[month end]))))
var last_month = CALCULATETABLE(VALUES('Table'[id]),FILTER('Table',MONTH('Table'[month end]) = MONTH(MAX('Table'[month end]))-1))
return
EXCEPT(last_month,this_month)

vjaywmsft_1-1657174575778.png

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @dadelta ,

 

This table needs to contain data for this month and last month.

For example:

vjaywmsft_0-1657174236886.png

Then you could create a new table like below:

Table 2 = 
var this_month = CALCULATETABLE(VALUES('Table'[id]),FILTER('Table',MONTH('Table'[month end]) = MONTH(MAX('Table'[month end]))))
var last_month = CALCULATETABLE(VALUES('Table'[id]),FILTER('Table',MONTH('Table'[month end]) = MONTH(MAX('Table'[month end]))-1))
return
EXCEPT(last_month,this_month)

vjaywmsft_1-1657174575778.png

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Ashish_Mathur
Super User
Super User

Hi,

In the Query Editor, you will first have to append both tables into a single table.  Once that is done, we can write DAX formulas to get your desired result.  Share the link from where i can download your PBI file with both/all tables appended into a single table.


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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.