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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
nj-matt
Helper I
Helper I

Compare 2 tables w/ specific requirements

Every day we are refreshing data based on reporting output to SQL.

 

So every day the query is moving yesterday's data and replacing with today's data and it looks something like this -->

 

data_today

data_yesterday

 

The column headers are always indentical, but we have different values for Sales and the possibility for a different number of rows.

 

Example -->

 

Today -->

 

CategoryProductSales
SnacksCookies100
SnacksCrackers75
CandyChocolate Bars200
CandyGum125

 

CategoryProductSales
SnacksCookies90
SnacksCrackers75
CandyChocolate Bars200

 

So in today's report, I need to see that Cookies increased from 90 to 100 and also we have a new line item for Gum at 125.

 

Here are the options I have considered -

 

1) Use a unique id (snacks_cookies, snacks_crackers, etc) - create a relationship between the 2 tables and / or lookup the value from yesterday's table.

2) APPEND the 2 tables, first re-naming Sales to "Yesterday Sales" so now I have double the rows, all columns filled and 2 sales columns

3) MERGE the 2 tables using ALL ROWS Outer so the # of rows today is the same and I add a new column for "Yesterday Sales"

4) Tag each data set with a report date and use some time intelligence to compare sales vs prior day in the same dataset

 

I know there are other options out there - any suggestions or considerations?

0 REPLIES 0

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Solution Authors