cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors