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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Parkyerbike
New Member

Trying to populate a column with data from another table, using a filter

Hi, I am new to Power BI and I am trying to create a column in a table with a customer name that is held in another table, but only where the environment is set to production

 

Example trying to populate the Customer Name in this DIM table. This table only has Unique values, the key is ID

 

1.png

 

From Data in this FACT table, but only where the environment is production, the column called CustomerDescr exists in the below table also, which is what I am trying to get in the above, this table has 500+ rows, and 300+ distinct values, the Key is IdentifiedInstallationID

 

2.png

 

I have relationships set up between the 2 tables (1 to Many)

 

3.png

 

Thanks in advance

 

Dave

1 ACCEPTED SOLUTION
hackcrr
Solution Supplier
Solution Supplier

Hi, @Parkyerbike 

You might want to try the following DAX expression:

 

Customer Name =
CALCULATE (
    MAX ( 'Table2'[CustomerDescr] ),
    FILTER (
        'Table2',
        'Table'[Id] = 'Table2'[IdentifiedInstallationID]
            && 'Table2'[Enviroment] = "Production"
    )
)

 

Below is the example data I used:

table1:

hackcrr_0-1715299830270.png

table2:

hackcrr_1-1715299850379.png

relationship:

hackcrr_2-1715299908813.png

The results of the calculation columns are shown below:

hackcrr_3-1715299983671.png

 

View solution in original post

2 REPLIES 2
Parkyerbike
New Member

@hackcrr Thanks, worked great

hackcrr
Solution Supplier
Solution Supplier

Hi, @Parkyerbike 

You might want to try the following DAX expression:

 

Customer Name =
CALCULATE (
    MAX ( 'Table2'[CustomerDescr] ),
    FILTER (
        'Table2',
        'Table'[Id] = 'Table2'[IdentifiedInstallationID]
            && 'Table2'[Enviroment] = "Production"
    )
)

 

Below is the example data I used:

table1:

hackcrr_0-1715299830270.png

table2:

hackcrr_1-1715299850379.png

relationship:

hackcrr_2-1715299908813.png

The results of the calculation columns are shown below:

hackcrr_3-1715299983671.png

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.