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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Likhitha
Helper IV
Helper IV

Doubt regarding data match between 2 different tables

Hello All,

I'm having 2 different tables A and B  with one common column "Product",I want to create a column in Table-A like Exclude and Include.

Exclude mean if Product in Table-B shouldn't be considered for calculation in Table -A or else it is Include .

For the above condition I created a column like

Excl/Incl=if (Tbl-A[Product] in DISTINCT(Tbl-B[Product]),"Exclude","Include")

For Example if my Tbl-B has 2 Products and Tbl-A has 6  Products my Exclude selection should show count as 4 and include should show 6.

But my condition gives Exclude as 2 and include as 4.

How to sort it out?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

Try a new column like this in table1

if(isblank(countx(filter([table2],table1[product]=table2[product]),table2[product])),"Include","Exclude")

Main calculation is

countx(filter([table2],table1[product]=table2[product]),table2[product])

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

Try a new column like this in table1

if(isblank(countx(filter([table2],table1[product]=table2[product]),table2[product])),"Include","Exclude")

Main calculation is

countx(filter([table2],table1[product]=table2[product]),table2[product])

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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