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
nbitabc
Helper I
Helper I

Retrieve value into one Dimension table into another dim table

We are new to PowerBI so please excuse if this question is too basic.

 

Have been trying to fetch a related value in a Dimension from another dim table but it is not working as expected.

 

Example - lets there are two Fact tables Sales Fact 7 Inventory Fact joined to two confirmed dimension tables with many to one relationship - Office Location, Region. 

I am trying to add a column into Office Location table that will display Region Text for all records where Office Location = 'Remote'

Something like,

Combined Location Column = IF Office Location = "Remote" THEN REGION (From Region Dimension) Else Office Location.

 

That way when user brings in the Calculated Combined Location column it will override the text for all 'remote' office location and display 'Region' 

Region text only exists only in Region Table and there is no direct link with Office Location table. 

 

Any help is appreciated.

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @nbitabc ;

I'm really sorry that I reconstructed the model, but there are still some deviations and I can't understand your logic. If you can modify it in my file and share the result you want to output, maybe it will be better? Or share your files after removing sensitive information? Looking forward to your reply!

Best Regards,
Community Support Team_ Yalan Wu

View solution in original post

7 REPLIES 7
v-yalanwu-msft
Community Support
Community Support

Hi, @nbitabc ;

I think it is more convenient to create measure, but it is difficult to create column, so another table needs to be created. If measure is used, please try:

Measure = IF(MAX('Office_Loc_Dim'[Office_Location])="Remote",MAX('Region_Dim'[Region]),MAX('Office_Loc_Dim'[Office_Location]))

The final output is shown below:

vyalanwumsft_0-1637720493746.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you. This will work in our requirement

v-yalanwu-msft
Community Support
Community Support

Hi, @nbitabc ;

I'm really sorry that I reconstructed the model, but there are still some deviations and I can't understand your logic. If you can modify it in my file and share the result you want to output, maybe it will be better? Or share your files after removing sensitive information? Looking forward to your reply!

Best Regards,
Community Support Team_ Yalan Wu

Hi @v-yalanwu-msft ,

 

Sorry if my explaination was not clear earlier.

 

Here is an example file with the scenario -

In the data model, you can see Office Location and Region are two different dimension tables and have no direct link between them. 

Related_Example_pbix 

 

nbitabc_0-1637682524087.png

 

 

Here is mockup desired output -

Desired_Output 

Need to create the Combined Office Loc-Region field in PowerBI report that can used with both Sales Fact and Inventory fact tables

 

nbitabc_1-1637682585088.png

 

Hope this clears this clears it up. Thanks for your help.

 

v-yalanwu-msft
Community Support
Community Support

Hi, @nbitabc ;

I'm really sorry that I can't fully understand the output result that your data model has been hoping for through your description. Based on my understanding, I made a simple sample:

1.simple file‘s model

vyalanwumsft_0-1636694439329.png

2. create a column .(Here you could change the 'B' to 'Remote'.)

Column = IF([Office Location]="B",RELATED('dimension'[Region]),[Office Location])

The final output is shown below:

vyalanwumsft_1-1636695106871.png

If this doesn't work for your model, can you make a simple file with the result you want to output along with the scene?

The most important parts are:
1. Sample data as text or screenshots.
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
Looking forward to your reply!
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yalanwu-msft,

 

Thank you for your response. 

In my case Region and Office location are two different Dimension tables and are not directly related. So RELATED functon will not work here. 

 

nbitabc_0-1637605443511.png

 

Ideally would like a single combined column that can be used along with both Sales Fact and Inventory Fact table in a single table. 

Example output -

 

nbitabc_1-1637605913564.png

 

Hope this is clear. Appreciate your assistance !

lbendlin
Super User
Super User

Most likely the dreaded LOOKUPVALUE() is what you are , erm, looking for.

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.