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
narasimhuluk
Frequent Visitor

Lookup types relations

SQL code: 

select 

LookupRepairTypeAR.Description AS RepairType

from 

 RepairWorksOrder AS RWO

Left Join

dbo.GetLookupDescription_AR('Repair Types') AS LookupRepairTypeAR ON RWO.RepairTypeId = LookupRepairTypeAR.LookupReference

 

details : 

RWO table 1 : repair typeid 

9
12
2
2
14
22
2
22

 

Lookuptype table 2:  lookup typeId , description 

1 Repair Types
2 Domain
3 SOR Tables
4 Repair Trades

 

i need to get the description of depair types where lookup type id is 1 

 

result should be like i want: 

9    day repair 
12  lift repair
2    heating repair
2    heating repair
14  lift repair
22 water 
2  heating
22  water 

 

how to achive above result in power bi  ?

2 ACCEPTED SOLUTIONS

1) thats how we are doing in sql to get repair type description .. as above sql query 

 

we dont have any table toget description of repair types 

 

View solution in original post

v-shex-msft
Community Support
Community Support

Hi @narasimhuluk,

 

According to your description, it seems like you are using the getlookupDescripiton table to search the detailed description of repair type. I'm not so sure for your data structures and relationships, please provide more detailed information about your scenario.

 

In addition, you can also try to use below calculate column formula to RWO table if it works: (I try convert your t-sql query to dax formula)

Desc =
LOOKUPVALUE (
    'GetLookupDescription_AR(Repair Types)'[Description],
    'GetLookupDescription_AR(Repair Types)'[LookupReference], RepairWorksOrder[repair typeid]
)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @narasimhuluk,

 

According to your description, it seems like you are using the getlookupDescripiton table to search the detailed description of repair type. I'm not so sure for your data structures and relationships, please provide more detailed information about your scenario.

 

In addition, you can also try to use below calculate column formula to RWO table if it works: (I try convert your t-sql query to dax formula)

Desc =
LOOKUPVALUE (
    'GetLookupDescription_AR(Repair Types)'[Description],
    'GetLookupDescription_AR(Repair Types)'[LookupReference], RepairWorksOrder[repair typeid]
)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

I guess you have the two tables "repairs" and "repair type" in PBI? Are they linked via a relationship using the repair code?
If so you don't need to create any LEFT JOIN as it's implicit in the relationship.

1) thats how we are doing in sql to get repair type description .. as above sql query 

 

we dont have any table toget description of repair types 

 

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.