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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

IF statement between two tables new column

Hi everyone, 

 

I have two tables and I am trying to match the product on the quote table to the product on the item database table and if they match put in a value from the item database table in a new column. My measure is as follows:

ItemMasterVS = 
VAR _part = 'Quote Report 24'[Quote Product]
return 
IF(
    CALCULATE(
        COUNTROWS('Item Master'),
        FILTER(
            ALL('Item Master'), 
            _part = 'Item Master'[Product])), 
            RELATED('Item Master'[VS]),
            "Not in ?")

Some of the "VS" values are being inputted, but many of them are coming up blank or "Not in ?". The blanks are 100% in both tables, but not reading the "VS" while the ones coming up as "Not in ?" are not in either sheet. Is it because of the RELATED function I am using?

 

Any help would be appreciated!

2 REPLIES 2
Anonymous
Not applicable

It has something to do with my relationship model. I created an index on the item database sheet as a many-to-many relationship issue occurs. 

Hi @Anonymous ,

 

Has your problem been solved? If it is solved, please accept your reply as the solution to help the other members find it more quickly.

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

 

Best Regards,
Winniz

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors