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
vnqt
Helper IV
Helper IV

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 IV
Helper IV

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
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.

Top Solution Authors