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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Rahul22
New Member

Find difference in two-month data by comparing two attributes.

Hi Team,

Need your help to built query to find the difference which value is added or removed from current & previous month and also consider if there is change in section. 
Exp. table - I have two month data (Month 1 & Month 2) ID & Section colum is common in both month. 
want to compair if there is any add & removed in ID plus also compair with section. 
ID - AB2 is present in both month but section is different in both month so it should count remove from 2B and added in 2C.

MonthIDSection MonthIDSection
1AB12A 2AB12A
1AB22B 2AB22C
1AB32C 2AB62A
1AB42A 2AB42A
1AB52C 2AB52B
4 REPLIES 4
Rahul22
New Member

Thankyou @rubayatyasmin for you effert and time, realy appricate.
I am trying to achive result in given format, trying to explain the required ask again. I have combile the two month data and now finding the total count for respective section and to also find if any change in section of given ID from current to prevous month.

MonthIDSection
Jul'23AB12A
Jul'23AB22B
Jul'23AB32C
Jul'23AB42A
Jul'23AB52C
Jun'23AB12A
Jun'23AB22C
Jun'23AB62A
Jun'23AB42A
Jun'23AB52B

 Example - 2B in jul on 1 entry (AB2) And in jun AB2 was under 2C and AB5 also under 2B which is moved to 2C in jul. Below table giving the same result and which is required as output. I have 20000 row data (for two month) looking some query which help to get the required result.  

SectionJul'23AddRemovedJun'23
2A2103
2B1111
2C2121


Thanks in Advance. Waiting for you inputs. 

 

Hey, 

 

Got this output. 

 

rubayatyasmin_0-1691669692096.png

 

Let me know if it helps. Need to adjust the logic a little bit I think. But this should help you a lot to achieve the result. 

 

ChangeDetection.pbix 

 

rubayatyasmin_0-1689517080227.png

 

 

 


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Hi @rubayatyasmin 
Thankyou for you support & effert. 
I tired the same steps which you followed in the attached file but for me its not giving me the same result. I have suggestion in place two different table can we add data in one sheet and with month colum to find Add & Remove on respective month againt each section.

rubayatyasmin
Super User
Super User

Hi, @Rahul22 

 

I tried to reproduce your problem. 

 

1. merge the tables

2. Add custom column

The result:

 

rubayatyasmin_0-1691592542527.png

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.