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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Finding Change Types between tables

Hello,

 

I have two different data sets. One is previous week of sales data, while the other is current week of sales data. Between these weeks of sales data, there may be changes made to the revenue of a sale, or it's probability of occuring. I am trying to create a measure that tracks these changes, but I am struggling with finding the right DAX functions for the job. 

 

Using these two tables, I have created a table that contaings the sales IDs that have been changed (call this ChangesData) in either revenue or sales probability, along with their new revenue, and their new sales probability. I also have a table containing the old data that we are updating from (call this OldData), which contains the same fields. I would like to create a measure that track the specific changes to each ID (whether it be sales probability or sales revenue) between these two tables, resulting in something that looks like the table below. Keep in mind that the Probability column is a categorical variable which levels are (50%, 70%, and 100%).

 

Sales IDRevenueProb.Change TypeResulting Change
123$120,00070%Revenue$20,000
456$40,00030%Sale Probability20% Increase
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , You merge in power query using ID and can create a column to  compare

Merge: https://radacad.com/append-vs-merge-in-power-bi-and-power-query

 

Power query column

if [Revenue] =  [New.Revenue] then "Match"  else "Different"

 

 

You can create a common ID tbale and compare meausre

 

if(Sum(Table1[Revenue]) = Sum(Table2[Revenue]) , "Match", "Different" )

 

https://amitchandak.medium.com/power-bi-when-i-asked-you-to-create-common-tables-a-quick-dax-solution-8e3eccb41bda

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , You merge in power query using ID and can create a column to  compare

Merge: https://radacad.com/append-vs-merge-in-power-bi-and-power-query

 

Power query column

if [Revenue] =  [New.Revenue] then "Match"  else "Different"

 

 

You can create a common ID tbale and compare meausre

 

if(Sum(Table1[Revenue]) = Sum(Table2[Revenue]) , "Match", "Different" )

 

https://amitchandak.medium.com/power-bi-when-i-asked-you-to-create-common-tables-a-quick-dax-solution-8e3eccb41bda

Anonymous
Not applicable

Looks like the power query column from M is working and giving me the correct results, but the measure using DAX is not working. No problem though, as the column from power query should suffice. Still wondering why power query and power BI don't share a language, but it seems like M is a lot less ambiguous. 

 

I appreciate your help. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors