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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
EZimmet
Resolver I
Resolver I

Two Tables unrelated need Column added with results of lookup

2 Tables from two different sources no relationship link between them

 

  • TABLE_1 – Holds info for Physical Assets
  • TABLE_2 – Holds info for Software, VM’s Physical Assets Ect…

 

I've done the following DAX to look for mismatches in the Serial Number Field.   – Works fine as some are flagged   

 _Find SN TABLE_1 to TABLE_2  = IF  (TABLE_1[SerialNum]  IN DISTINCT  (TABLE_2[SERIAL_NUMBER])  , 1, 0 )

 

EZimmet_0-1674741931279.png

 

Need help on this next step

With your assistance I need a New Column added to TABLE_1 populated with the mismatched data from TABLE_2 to send off for validation.

 

EZimmet_2-1674742314598.png

1 ACCEPTED SOLUTION

@EZimmet  something like this, pbix is attached

 

 

Column =
CALCULATE (
    MAXX ( t2, t2[Column1] ),
    TREATAS (
        {
            IF (
                t1[sn]
                    <> CALCULATE (
                        CALCULATE (
                            MAXX ( t2, t2[sn] ),
                            TREATAS ( SUMMARIZE ( t1, t1[Column1], t1[sn] ), t2[Column1], t2[sn] )
                        )
                    ),
                t1[sn]
            )
        },
        t2[sn]
    )
)

 

 

smpa01_0-1674749423120.png

 

smpa01_1-1674749440134.png

 

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

5 REPLIES 5
smpa01
Super User
Super User

@EZimmet 

 

 

calculatedColumninT1 = CALCULATE(MAX(t2[valueToReturn]),TREATAS(VALUES(t2[columnToLookup]),t1[columnToLookup]))

 

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

calculatedColumninT1 =

TABLE_1[SerialNum]

=

CALCULATE(MAX(TABLE_2[SERIAL_NUMBER]

),

TREATAS(VALUES(TABLE_2[SERIAL_NUMBER]

),

TABLE_1[SerialNum]

))

 

-------------------------

I get this in TABLE_1

EZimmet_0-1674744656680.png

 

Sorry, this should be the one

 

Column = t1[Column1]=CALCULATE(CALCULATE(MAXX(t2,t2[Column1]),TREATAS(VALUES(t1[Column1]),t2[Column1])))

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

 

This is the format I need a New Column added showing the bad Serial Number 

 

EZimmet_0-1674746031468.png

 

@EZimmet  something like this, pbix is attached

 

 

Column =
CALCULATE (
    MAXX ( t2, t2[Column1] ),
    TREATAS (
        {
            IF (
                t1[sn]
                    <> CALCULATE (
                        CALCULATE (
                            MAXX ( t2, t2[sn] ),
                            TREATAS ( SUMMARIZE ( t1, t1[Column1], t1[sn] ), t2[Column1], t2[sn] )
                        )
                    ),
                t1[sn]
            )
        },
        t2[sn]
    )
)

 

 

smpa01_0-1674749423120.png

 

smpa01_1-1674749440134.png

 

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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