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
iksaum
Regular Visitor

comparing 2 tables

I have 2 tables:

Comment IDBlock #Audited ByBroadThemeSub-ThemeProblemLocation
21065761KM     
27022822KM     
130569601KMProductQuality/Price   
111206861KMProductSizeDimensionsIncorrect 
111206862KMProductQuality/Price   
286706482KMProductQuality/Price   
286706484KM     
110784932KMProductMaterialComfort  
110784933KMProductColorBrightness/ToneIncorrectImage
179552801KMLogisticsDefect/DamageDamage  
179552804KM     
75175551KMProductSize IncorrectImage
136307311KMProductSize   
136307314KMProductMaterialTexture  
108667183KMServiceCommunication  Phone
90393921KMProductQuality/Price   
219904091KMLogisticsTime   
219904094KMLogisticsDefect/Damage   
235447711KM     
130334133KMProductColorDidn't match decor  
83678742KMProductAssembly   
55938601KM     
186125061KMProductQuality/Price   
184080733KMServiceCommunication  Chat
132217751KMProductQuality/PriceStability/Flimsiness  
132217752KM     
49646453KMLogisticsCarrier/DAOn-site behaviour  
49646454KMProductMaterialComfort  
135430171KMProductColorPattern  
135430172KM     
49663032KMProductMaterialConstruction Materials  
49728923KMProductUsabilityCompatibility  
88316731KMProductColor Incorrect 
88622841KMLogisticsCarrier/DA   
102278361KMProductMaterialConstruction MaterialsMissing (information/context) 
215257242KMLogisticsMissing Parts   
215257244KMLogisticsDefect/DamageDefect  
148797332KMProductColorBrightness/ToneIncorrectImage
110693422KMLogisticsTime   
62709991KMLogisticsMissing Parts   

and

Comment IDBlock #Audited ByBroadThemeSub-ThemeProblemLocation
21065761KMProductUsabilityFeatures  
27022822KMProductUsabilityFeatures  
130569601KMProduct   Image
111206861KMProductSizeDimensionsIncorrectImage
111206862KM     
286706482KMLogisticsDefect/DamageDefect  
286706484KMProductColor   
110784932KMProductAssembly   
110784933KMProductColor  Image
179552801KMLogisticsCarrier/DA   
179552804KMServiceCommunication   
75175551KMProductSize  Description
136307311KMProductSizeDimensions  
136307314KM     
108667183KM     
90393921KMProductMaterial   
219904091KMLogisticsTimeDelay  
219904094KM     
235447711KMLogisticsCarrier/DAProduct handling  
130334133KMProductColor   
83678742KM     
55938601KMCustomerChanged Mind/Error   
186125061KMProductSizeCapacity  
184080733KM     
132217751KMProductQuality/Price   
132217752KMProductUsability   
49646453KMService    
49646454KMProductColorDidn't match decor  
135430171KMProduct   Image
135430172KMLogisticsMis-Ship   
49663032KM     
49728923KM     
88316731KMProductColor   
88622841KMLogisticsMis-Ship   
102278361KMProduct   Description
215257242KMProductItems Included  Image
215257244KM     
148797332KMProductColor IncorrectImage
110693422KMLogistics    
62709991KMLogistics    

 

Is there any way that I can count the number of changes in these two tables in power bi??

 

please help!!

1 ACCEPTED SOLUTION
tex628
Community Champion
Community Champion

To my knowledge there is no simple way to make that calculation. I have a solution that requires abit of work:

It looks like "Comment ID" and "Block #" can be combined to create a unique key. 

If this is the case you would create that key in both tables and then merge them together on that key. 
Include all columns from both tables. This should give you "Audited by" ... "Audited by.1" ... "Broad" ... "Broad.1" ... etc.

The next step is to create a custom column for each pair of columns:

Column = if [Audited by] = [Audited by.1] then 0 else 1


Create one for each pair of columns and then summarize the value of all these custom columns. Should give you the number of changed rows. 

/J


Connect on LinkedIn

View solution in original post

5 REPLIES 5
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @iksaum ,

I'm a little confused about your desired output. 

If it is convenient, could you describe your logic in details and your expected output so that we could give further advice?

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-piga-msft 
The two tables shown above have the same column headers but some of the columns have different values. Is there any way as to which the number of changes can be calculated in these two tables??

tex628
Community Champion
Community Champion

To my knowledge there is no simple way to make that calculation. I have a solution that requires abit of work:

It looks like "Comment ID" and "Block #" can be combined to create a unique key. 

If this is the case you would create that key in both tables and then merge them together on that key. 
Include all columns from both tables. This should give you "Audited by" ... "Audited by.1" ... "Broad" ... "Broad.1" ... etc.

The next step is to create a custom column for each pair of columns:

Column = if [Audited by] = [Audited by.1] then 0 else 1


Create one for each pair of columns and then summarize the value of all these custom columns. Should give you the number of changed rows. 

/J


Connect on LinkedIn
tex628
Community Champion
Community Champion

You want to count every change in every cell between the two tables? 


Connect on LinkedIn

@tex628 YES

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.