The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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.
Month | ID | Section | Month | ID | Section | |
1 | AB1 | 2A | 2 | AB1 | 2A | |
1 | AB2 | 2B | 2 | AB2 | 2C | |
1 | AB3 | 2C | 2 | AB6 | 2A | |
1 | AB4 | 2A | 2 | AB4 | 2A | |
1 | AB5 | 2C | 2 | AB5 | 2B |
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.
Month | ID | Section |
Jul'23 | AB1 | 2A |
Jul'23 | AB2 | 2B |
Jul'23 | AB3 | 2C |
Jul'23 | AB4 | 2A |
Jul'23 | AB5 | 2C |
Jun'23 | AB1 | 2A |
Jun'23 | AB2 | 2C |
Jun'23 | AB6 | 2A |
Jun'23 | AB4 | 2A |
Jun'23 | AB5 | 2B |
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.
Section | Jul'23 | Add | Removed | Jun'23 |
2A | 2 | 1 | 0 | 3 |
2B | 1 | 1 | 1 | 1 |
2C | 2 | 1 | 2 | 1 |
Thanks in Advance. Waiting for you inputs.
Hey,
Got this output.
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.
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.
Hi, @Rahul22
I tried to reproduce your problem.
1. merge the tables
2. Add custom column
The result:
Proud to be a Super User!
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
102 | |
95 | |
80 | |
62 | |
56 |
User | Count |
---|---|
256 | |
120 | |
112 | |
83 | |
71 |