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
Varshi288
Resolver I
Resolver I

Converting Dax to M

 

Hi  

I want to convert this Dax to M code. to get this column while loading the data. Appriciate your help.

 

Customer HQ =

VAR HQ_name = IF(ISBLANK(RELATED('Customer GUID'[Customer Global HQ name])),RELATED(Customer_local[Customer HQ (mapping)]),RELATED('Customer GUID'[Customer Global HQ name]))
VAR HQ_name2=LOOKUPVALUE('Customer GUID'[Customer Global HQ name],'Customer GUID'[Global HQ no],Data[Customer HQ GUID])
    RETURN
 IF(OR(ISBLANK(HQ_name2),HQ_name2="**not mapped**"),IF(ISBLANK(HQ_name),"**not mapped**",HQ_name),HQ_name2)
1 ACCEPTED SOLUTION

Hi  @v-cgao-msft 

 

Thanks. This worked with slight modifiaction.

View solution in original post

2 REPLIES 2
v-cgao-msft
Community Support
Community Support

Hi @Varshi288 ,

Please refer to the steps in the 'Data' table. RELATED() and LOOKUPVALUE() are similar to Merge Query. the last IF() can be slightly modified in the code of the condition column.

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Hi  @v-cgao-msft 

 

Thanks. This worked with slight modifiaction.

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
Top Kudoed Authors