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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
dparkinson
Advocate I
Advocate I

Create a Calculated Table of Differences between Tables

I have an SQL Table that keeps a snapshot of the data that was used in a report from the previous week.  I have imported this table into the Power BI Desktop report that has the current weeks report.

 

I'd like to be able to create a calculated table that contains rows for any records where the values in the snapshot from last week are different this week.

 

This is an "Opportunities" list and by different, I mean the following could have changed:

  • Status: It could have moved from In Progress to Won or Lost
  • CloseBy Date: The date could have slipped outside of the 90 day window I'm reporting on
  • New Opportunities: Opportunities that are in the list now that were not there last week
  • Opportunity Value: The value of the opportunity has changed

 

So essentially, the steps I need to take are:

  • select all the rows from the current report that are not in the snapshot report
  • select all the rows from the snapshot report that are not in the current report
  • for all other rows in the current report, compare the values of various value columns, if they are different, also add those.

 

Any thoughts on how I might address this would be greatly appreciated.

Many thanks,

Kind regards,

D.

 

 

3 REPLIES 3
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @dparkinson,

 

Have you tried the solutions provided above? Do they work in your scenario? If the solution works, could you accept it as solution to close this thread?

 

If you still have any question on this issue, feel free to post here. Smiley Happy

 

Regards

Ashish_Mathur
Super User
Super User

Hi,

 

Power Query has various types of joins which should address your first two convers atleast.  Please try them.


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

Hi,

May be

Table =
UNION (
    CALCULATETABLE ( TableCurrent, EXCEPT ( TableCurrent, TableSnapshot ) ),
    CALCULATETABLE ( TableSnapshot, EXCEPT ( TableSnapshot, TableCurrent ) )
)

Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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