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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
romovaro
Responsive Resident
Responsive Resident

Quality check from Form and Excel file

Hi

 

I am trying to biuld a formula to check if the Capacity Bucket is showing the correct information from a Microsfot Form

 

 

romovaro_1-1741344865159.png

 

I have an Excel file with countries and bucket Options. SOme countries have 2 Buckets and other 3 buckets.

Using the country Code as link, I need to compare what the form says vs the options from the excel and detect if different.

 

Region ContryCountry codeBucket1Bucket2Bucket3
AMERAntigua & BarbudaAGPMC AMERPM AMER 
AMERArgentinaARPMC AMERPM AMER 
AMERArubaAWPMC AMERPM AMER 
AMERBahamasBSPMC AMERPM AMER 
AMERUruguayUYPMC AMERPM AMER 
AMERVenezuelaVEPMC AMERPM AMER 
APACAustraliaAUPMC APACPM APAC 
APACBangladeshBDPMC APACPM APAC 
APACCambodiaKHPMC APACPM APAC 
APACBruneiBNPMC APACPM APAC 
APACChinaCNPMC APACPM APAC 
APACFijiFJPMC APACPM APAC 
APACGuamGUPMC APACPM APAC 
APACHong KongHKPMC APACPM APAC 
APACIndiaINPMC APACPM APAC 
APACVietnamVNPMC APACPM APAC 
EMEAAlbaniaALPMC EMEAPM EMEASBS EMEA
EMEAAlgeriaDZPMC EMEAPM EMEASBS EMEA
EMEAAngolaAOPMC EMEAPM EMEASBS EMEA
EMEAArmeniaAMPMC EMEAPM EMEASBS EMEA
EMEAAustriaATPMC EMEAPM EMEASBS EMEA
EMEAAzerbaijanAZPMC EMEAPM EMEASBS EMEA

 

That's the relationship

 

romovaro_0-1741344750942.png

 

Any help is welcome

 

Thanks,

 

 

2 ACCEPTED SOLUTIONS
bhanu_gautam
Super User
Super User

@romovaro Use DAX (Data Analysis Expressions) to create a custom column that checks if the Capacity Bucket from the form matches any of the buckets in the Excel file.

DAX
BucketMatch =
VAR FormBucket = 'FormData'[Bucket]
VAR CountryCode = 'FormData'[Country code]
VAR Bucket1 = LOOKUPVALUE('ExcelData'[Bucket1], 'ExcelData'[Country code], CountryCode)
VAR Bucket2 = LOOKUPVALUE('ExcelData'[Bucket2], 'ExcelData'[Country code], CountryCode)
VAR Bucket3 = LOOKUPVALUE('ExcelData'[Bucket3], 'ExcelData'[Country code], CountryCode)
RETURN
IF(
FormBucket = Bucket1 || FormBucket = Bucket2 || FormBucket = Bucket3,
"Match",
"No Match"
)

 

You can now create a visual in Power BI to display the results of the BucketMatch column, showing which entries match and which do not.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

Ray_Minds
Continued Contributor
Continued Contributor

Hi  @romovaro

I replicated your scenario in Power BI Desktop.    

 

 
NOTE: In the below example, I am assuming you want to compare values in ISLOT Extract table from Bucket table.  

 
Below is the steps and recommendation which may help here: 
 

Step –1: Right click on ISLOT table and click on New column. 
 

 

 

Step –2: Paste the below code. 
 

Bucket Comparison =  

IF( 

    'ISLOT Extract'[Capacity Bucket] IN VALUES('Bucket Table'[Bucket1]) || 

    'ISLOT Extract'[Capacity Bucket] IN VALUES('Bucket Table'[Bucket2]) || 

    'ISLOT Extract'[Capacity Bucket] IN VALUES('Bucket Table'[Bucket3]), 

    "Correct", 

    "Mismatch" 


 

After pasting the above code, it will look like below: 
 

 

 
 

This formula checks if the Capacity Bucket from 'ISLOT Extract' is present in any of the Bucket1, Bucket2, or Bucket3 columns in the 'Bucket Table' for the corresponding Country Code. If a match is found, it returns "Correct". Otherwise, it returns "Mismatch". 

 

Below is what it will look like in the table view: 
 
NOTE: I have purposely not loaded data for PM AMER and PMC AMER in Bucket table only so that, I can show some mismatch values as well working as per the code. 

 

 

Ray_Minds_0-1741758151133.png

Ray_Minds_2-1741758004188.jpeg

Ray_Minds_1-1741758209101.png



If your requirement is solved, please make THIS ANSWER a SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you.

View solution in original post

2 REPLIES 2
Ray_Minds
Continued Contributor
Continued Contributor

Hi  @romovaro

I replicated your scenario in Power BI Desktop.    

 

 
NOTE: In the below example, I am assuming you want to compare values in ISLOT Extract table from Bucket table.  

 
Below is the steps and recommendation which may help here: 
 

Step –1: Right click on ISLOT table and click on New column. 
 

 

 

Step –2: Paste the below code. 
 

Bucket Comparison =  

IF( 

    'ISLOT Extract'[Capacity Bucket] IN VALUES('Bucket Table'[Bucket1]) || 

    'ISLOT Extract'[Capacity Bucket] IN VALUES('Bucket Table'[Bucket2]) || 

    'ISLOT Extract'[Capacity Bucket] IN VALUES('Bucket Table'[Bucket3]), 

    "Correct", 

    "Mismatch" 


 

After pasting the above code, it will look like below: 
 

 

 
 

This formula checks if the Capacity Bucket from 'ISLOT Extract' is present in any of the Bucket1, Bucket2, or Bucket3 columns in the 'Bucket Table' for the corresponding Country Code. If a match is found, it returns "Correct". Otherwise, it returns "Mismatch". 

 

Below is what it will look like in the table view: 
 
NOTE: I have purposely not loaded data for PM AMER and PMC AMER in Bucket table only so that, I can show some mismatch values as well working as per the code. 

 

 

Ray_Minds_0-1741758151133.png

Ray_Minds_2-1741758004188.jpeg

Ray_Minds_1-1741758209101.png



If your requirement is solved, please make THIS ANSWER a SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you.

bhanu_gautam
Super User
Super User

@romovaro Use DAX (Data Analysis Expressions) to create a custom column that checks if the Capacity Bucket from the form matches any of the buckets in the Excel file.

DAX
BucketMatch =
VAR FormBucket = 'FormData'[Bucket]
VAR CountryCode = 'FormData'[Country code]
VAR Bucket1 = LOOKUPVALUE('ExcelData'[Bucket1], 'ExcelData'[Country code], CountryCode)
VAR Bucket2 = LOOKUPVALUE('ExcelData'[Bucket2], 'ExcelData'[Country code], CountryCode)
VAR Bucket3 = LOOKUPVALUE('ExcelData'[Bucket3], 'ExcelData'[Country code], CountryCode)
RETURN
IF(
FormBucket = Bucket1 || FormBucket = Bucket2 || FormBucket = Bucket3,
"Match",
"No Match"
)

 

You can now create a visual in Power BI to display the results of the BucketMatch column, showing which entries match and which do not.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.