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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
asparagus1_
Frequent Visitor

DAX LOOKUPVALUE, RELATED - writing a measure

Hi,

I have three tables, and I want to identify which vendors from the Products table are also present in the Order Ext. Details table. The goal is to create a measure that returns "Yes" when we can find a non-blank Shop value from the Order Ext. Details table. This will help us determine which vendors are assigned to shops and which are not.

I hope this explanation is clear. I attempted to use LOOKUPVALUE/RELATED, but I didn't get the expected results. Here's what I tried:

LOOKUPVALUE('Products'[Vendor], Products[Product_ID], LOOKUPVALUE('Bridge'[Product_ID], 'Bridge'[Market_ID], 'Orders Ext. Details'[Market_ID]))

asparagus1__0-1741884793326.png

 

2 ACCEPTED SOLUTIONS
uzuntasgokberk
Super User
Super User

Hello @asparagus1_ ,

 

There is a 1to*(single) relationships your data model. You can use two methos that are change relationship from single to both or use crossfilters function in your dax(it is best practice mostly). İf you choose first way you'll notice when you put vendor column(Products) to table and Shop column(Order Ext. Details). You'll see blank and non-blank shops and then you can filter to show non-blank values from filter pane. I hope it helps.

Kind Regards,
Gökberk Uzuntaş

📌 If this post helps, then please consider Accepting it as a solution and giving Kudos — it helps other members find answers faster!

🔗 Stay Connected:
📘 Medium |
📺 YouTube |
💼 LinkedIn |
📷 Instagram |
🐦 X |
👽 Reddit |
🌐 Website |
🎵 TikTok |

View solution in original post

Anonymous
Not applicable

Hi @asparagus1_ ,

Based on the information, try using the following DAX formula.

Vendor Has Shop =
VAR CurrentProduct = SELECTEDVALUE(Products[Product_ID])
VAR RelatedMarkets =
    CALCULATETABLE(
        VALUES(Bridge[Market_ID]),
        Bridge[Product_ID] = CurrentProduct
    )
VAR ShopFound =
    CALCULATE(
        SELECTEDVALUE('Orders Ext. Details'[Shop]),
        FILTER(
            'Orders Ext. Details',
            'Orders Ext. Details'[Market_ID] IN RelatedMarkets &&
            NOT(ISBLANK('Orders Ext. Details'[Shop]))
        )
    )
RETURN
    IF( NOT ISBLANK(ShopFound), "Yes", "No" )

 

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @asparagus1_ ,

Based on the information, try using the following DAX formula.

Vendor Has Shop =
VAR CurrentProduct = SELECTEDVALUE(Products[Product_ID])
VAR RelatedMarkets =
    CALCULATETABLE(
        VALUES(Bridge[Market_ID]),
        Bridge[Product_ID] = CurrentProduct
    )
VAR ShopFound =
    CALCULATE(
        SELECTEDVALUE('Orders Ext. Details'[Shop]),
        FILTER(
            'Orders Ext. Details',
            'Orders Ext. Details'[Market_ID] IN RelatedMarkets &&
            NOT(ISBLANK('Orders Ext. Details'[Shop]))
        )
    )
RETURN
    IF( NOT ISBLANK(ShopFound), "Yes", "No" )

 

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ashish_Mathur
Super User
Super User

Hi,

Share some data to work with, explain the question and show the expected result.  Share data in a format that can be pasted in an MS Excel file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
uzuntasgokberk
Super User
Super User

Hello @asparagus1_ ,

 

There is a 1to*(single) relationships your data model. You can use two methos that are change relationship from single to both or use crossfilters function in your dax(it is best practice mostly). İf you choose first way you'll notice when you put vendor column(Products) to table and Shop column(Order Ext. Details). You'll see blank and non-blank shops and then you can filter to show non-blank values from filter pane. I hope it helps.

Kind Regards,
Gökberk Uzuntaş

📌 If this post helps, then please consider Accepting it as a solution and giving Kudos — it helps other members find answers faster!

🔗 Stay Connected:
📘 Medium |
📺 YouTube |
💼 LinkedIn |
📷 Instagram |
🐦 X |
👽 Reddit |
🌐 Website |
🎵 TikTok |

Thank you! This is what I was looking for.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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