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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
vnqt
Helper V
Helper V

Look for rows in another table from a dax filtered value

Hi, 

 

I would like to create a identity card of a machine. This machine has values in different tables. 

To display the machine name, i use the following DAX : 

Machine name = IF (HASONEVALUE (Table1[Machinename]),SELECTEDVALUE (Table1[MachineName]),"")
I would like to display all the related values of this machine, it works well if these values are in the same table. 
How could I look for the certain related in another table? 
 
Thank you in advance for your help.
 
Tg 
1 ACCEPTED SOLUTION
Jos_Woolley
Solution Sage
Solution Sage

Hi,

Something like:

Details Selected Machine Name =
VAR SelectedMachineName = [Machine name]
RETURN
    CALCULATE(
        MIN( Table2[SECTION] ),
        FILTER( Table1, Table1[Machine name] = SelectedMachineName )
    )

Regards

View solution in original post

4 REPLIES 4
Jos_Woolley
Solution Sage
Solution Sage

Hi,

Something like:

Details Selected Machine Name =
VAR SelectedMachineName = [Machine name]
RETURN
    CALCULATE(
        MIN( Table2[SECTION] ),
        FILTER( Table1, Table1[Machine name] = SelectedMachineName )
    )

Regards

vnqt
Helper V
Helper V

Thank you for your replies. Here I add more information

Table1

NAMEGROUP
NAME1GROUP A
NAME2GROUP A
NAME3GROUP A
NAME4GROUP B
NAME5GROUP B
NAME6GROUP B
NAME7GROUP C
NAME8GROUP C
NAME9GROUP C
NAME10GROUP C
NAME11GROUP C
NAME12GROUP C
NAME13GROUP D 
NAME14GROUP F
NAME15

GROUP F

 

Table2

 

SECTIONSUB SECTION GROUP
SECTION 1SUB SECTION 11GROUP A
SECTION 1SUB SECTION 12GROUP B
SECTION 1SUB SECTION 13GROUP C
SECTION 1SUB SECTION 14GROUP D
SECTION 2SUB SECTION 21GROUP E
SECTION 2SUB SECTION 22GROUP F
SECTION 3SUB SECTION 31GROUP H
SECTION 3SUB SECTION 32GROUP I
SECTION 3SUB SECTION 33GROUP J
SECTION 3SUB SECTION 34GROUP K

 

vnqt_0-1665262319823.png

 

vnqt_1-1665262437152.png

I would like to display the section and sub section of the selected machine name.

 

Thank you in advance for your help.

Tg 

 

 

AilleryO
Memorable Member
Memorable Member

Hi,

We need more information to help you, but at least I can give you some hints that might help.

If both table are linked in Model view you can use RELATED function to get the value from the other table (going from many to one in the relation).

Otherwise you have LOOKUPVALUE function, or merging with Power Query...

In fact many options but depends on your situation.

Let us know

Shaurya
Memorable Member
Memorable Member

Hi @vnqt,

 

You can lookup values in another table by using the LOOKUP function.

 

Please refer to:

 

https://learn.microsoft.com/en-us/dax/lookupvalue-function-dax

 

Mark this post as a solution if that works for you!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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