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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Nazdac911
Helper II
Helper II

In calculated column , how to replace Lookupvalue with Related and create SQL script

Hi All

I have 2 tables : Table 1 and Table 2 , (1 --> M relation)

In Table 1: I am creating the  following calculated column:

Nazdac911_0-1668243602242.png

 

 

TableA[Col Z] =

LOOKUPVALUE(

        TableB[Col X] , Table[B] [Col Y], "String_Value",

        TableA[Col PK] , TableB[Col SK] , 

        "N/A")

 

This line work great .

I need help for 2 things:

  • I want to use Related instead of lookup
  • How could I create the equivalent SQL script for this DAX script?

Thanks in advance  

2 REPLIES 2
amitchandak
Super User
Super User

@Nazdac911 , A new column in Table A

 

Coalesce(maxx(filter(Table2, Table[2] = "Value"), Table2[X]) , 0)

 

or

 

Coalesce(sumx(filter(Table2, Table[2] = "Value"), Table2[X]) , 0)

 

 

refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

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

Hi 

Thank you for the fast reply .. 

I will need to digest the coalsec function , i never work with it before .. 

but unfortunality it did not work and gave me the follwoing error message 

Nazdac911_0-1668243833159.png

I updated my lookupvalue function and added the Value is a string value ( all relative columns are string columns) 

Thank you for sharng the youtube videios , they are of great value 

Regarda 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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