Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi,
I have three tabels: Orders, ShoppingCart and Item. I have thte following realtionships:
Orders:ShoppingCart 1:M on OrderNumber
Item: ShoppingCart 1:M on ProductID
I am trying to set a Item.URL to a value, based on the associated value for the related order in Orders.Prefix. I am using the following code:
Table.AddColumn(#"Added Conditional Column1", "ThumbNailImageURL", each if RELATED('Orders'[Prefix] = "Z") then “https://www.gotaces.com” + [ImagePath] else if RELATED('Orders'[Prefix] = "A") then “https://www.asbaces.com” + [ImagePath] else null)
I do not have a direct realtionship between the Orders table and the Item Table. Any ideas on why this is not working for me?
Cheers!
Peter
Solved! Go to Solution.
@asbpowerbi first the code you are showing is an M code, not DAX, so you need to add a column using DAX in the shoppingcard table
ThumbNailImageURL= if RELATED('Orders'[Prefix] = "Z") then “https://www.gotaces.com” + RELATED(Item[ImagePath]) else if RELATED('Orders'[Prefix] = "A") then “https://www.asbaces.com” + RELATED(Item[ImagePath]) else null)
👉 Learn Power BI and Fabric - subscribe to our YT channel - @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤️
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@asbpowerbi already in my reply.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@asbpowerbi first the code you are showing is an M code, not DAX, so you need to add a column using DAX in the shoppingcard table
ThumbNailImageURL= if RELATED('Orders'[Prefix] = "Z") then “https://www.gotaces.com” + RELATED(Item[ImagePath]) else if RELATED('Orders'[Prefix] = "A") then “https://www.asbaces.com” + RELATED(Item[ImagePath]) else null)
👉 Learn Power BI and Fabric - subscribe to our YT channel - @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤️
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Thanks for the quick reply. What would the DAX code look like?
Hi,
The solution that worked for me was to pur the measure in the ShoppingCart table rather than the Item table. I beleive that is because with I used the Related term in the Item tabale, it did not know which ShoppingCart entry was being referred to as was suggested. I did not understand the imapct of a 1:M relationship.
Cheers!
User | Count |
---|---|
120 | |
65 | |
62 | |
56 | |
50 |
User | Count |
---|---|
181 | |
85 | |
69 | |
62 | |
55 |