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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
joreghi
Regular Visitor

Looking for a DAX Function to bring data from another table

 

Dear DAX Experts!

 

I am new to Power BI DAX and I would need your help!

I need to find a way to bring data stored in table "DIM 2" to the table "FACT 1".
Both tables are not directly linked. Our data model looks something like this:

 

joreghi_0-1684741849458.png

 

I have tried the RELATED function, but this only works for DIM 1, which is directly linked to FACT 1.

Is there any function that would solve the above scenario?

 

Thank you in advance for any guidance!

 

1 ACCEPTED SOLUTION

@joreghi 
1.png

Calc Column DIM2 = 
CALCULATE ( 
    SELECTEDVALUE ( DIM2[Col1] ),
    CROSSFILTER ( FACT1[SK_COMMONDIM], COMMON_DIM[SK_COMMONDIM], BOTH ),
    CROSSFILTER ( FACT2[SK_DIM2], DIM2[SK_DIM2], BOTH )
)

However, this is not conclusive as one row is not sufficient to verify the data structure of a table.

View solution in original post

6 REPLIES 6
tamerj1
Super User
Super User

Hi @joreghi 
Based on what?

Hi @tamerj1 , Sorry, not sure I underestand the question.

I am trying to create a calculated column in table FACT1, containing a column in DIM2. The calculated column has to be stored in FACT1. The question is whether there is a "smart" function in Power BI that allows this, such as RELATED (which is not working for this scenario).

 

@joreghi 
Can you please provide an example? A simple sample data along with the expected result and the logic behind it.

Hi @tamerj1 
I have created a quick power bi example, so the expected result is to have the Col1 from DIM2 as a calculated column in FACT1.
The file can be accessed here : https://drive.google.com/file/d/1eHck0Z4W9tpIeak4-AmHQh8qUuNExp7W/view?usp=share_link

 

In advance, thanks a lot for your time!

Hi @tamerj1 
I have created a quick power bi example, so the expected result is to have the Col1 from DIM2 as a calculated column in FACT1.
The file can be accessed here : https://drive.google.com/file/d/1eHck0Z4W9tpIeak4-AmHQh8qUuNExp7W/view?usp=share_link

 

In advance, thanks a lot for your time!

@joreghi 
1.png

Calc Column DIM2 = 
CALCULATE ( 
    SELECTEDVALUE ( DIM2[Col1] ),
    CROSSFILTER ( FACT1[SK_COMMONDIM], COMMON_DIM[SK_COMMONDIM], BOTH ),
    CROSSFILTER ( FACT2[SK_DIM2], DIM2[SK_DIM2], BOTH )
)

However, this is not conclusive as one row is not sufficient to verify the data structure of a table.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.