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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Kristofferaabo
Helper IV
Helper IV

lookup between tables

Hi!
I have a table which is linked to two tables thorugh the same relationship: "Project number"

 

I now want to make a column which returns 'Yes' if the given project number is in either of the linked tables.

 

Makes sense?

Krsitoffer

 

 

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

HI @Kristofferaabo

 

Try this COlumn

 

Column =
IF (
    OR (
        CALCULATE ( COUNTROWS ( LinkedTable1 ) ) > 0,
        CALCULATE ( COUNTROWS ( LinkedTable2 ) ) > 0
    ),
    "Yes"
)

Regards
Zubair

Please try my custom visuals

View solution in original post

9 REPLIES 9
Zubair_Muhammad
Community Champion
Community Champion

HI @Kristofferaabo

 

Try this COlumn

 

Column =
IF (
    OR (
        CALCULATE ( COUNTROWS ( LinkedTable1 ) ) > 0,
        CALCULATE ( COUNTROWS ( LinkedTable2 ) ) > 0
    ),
    "Yes"
)

Regards
Zubair

Please try my custom visuals

Hi,

 

@Zubair_Muhammad thanks for your input! always a pleasure! 

 

Below is by relationships, table A, B and C all have the column 'Project'. I would like to be able to have column in table A indicating whether the project is also present in table B and C. Either with a Yes, or 1 or similar..

 

That way I can filter it off/on

 

Thanks

Kristoffer

 

PBI_columns.jpg

 

Hi

Did you try the above formula?

Regards
Zubair

Please try my custom visuals

Yes, perhaps I misunderstand it, but it found 'find' the columns..

I tried this:

Column =
IF (
    OR (
        CALCULATE ( COUNTROWS ( TABLE B [Project] ) ) > 0,
        CALCULATE ( COUNTROWS ( TABLE C [PROJECT] ) ) > 0
    ),
    "Yes"
)

It worked?

Regards
Zubair

Please try my custom visuals

No i cant get powerBI to find/suggest the tables, I tried the RELATED function also...

It also asked for a table? I guess it suppose to be columns?

Hi @Kristofferaabo

 

This is a DAX formula for a calculated column in Table A

 

When I use this formula using some dummy data...it works

 

Could you show the screen shot of the error you get?? or share your file??


Regards
Zubair

Please try my custom visuals

Hi! I think did something weird in the relationship! it works now.. ! Your solution is great thanks!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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