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
Bharathi_99
Helper V
Helper V

LookUp

Hi all,

I have ContID in Dim table and I have ContID in Fact table,
I want to get only those ContID's in dim table into fact table

Instead of Inner Join on ContID's from two tables I weanna do this

Please help

Thanks

7 REPLIES 7
v-zhangti
Community Support
Community Support

Hi, @Bharathi_99 

 

Can you provide sample data for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures or Excel. 

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

AmiraBedh
Most Valuable Professional
Most Valuable Professional

To filter the `ContID` in the Fact table based on the `ContID` in the Dim table using DAX, you can use the `FILTER` function.

Let's say your tables are named `DimTable` and `FactTable`.

You can create a new column or table in your Power BI model to achieve this filtering. Here's an example of how you can achieve this with a new column:

Filtered ContID =
IF(
CONTAINS(DimTable, DimTable[ContID], FactTable[ContID]),
FactTable[ContID],
BLANK()
)

This formula checks if the `ContID` in the FactTable exists in the DimTable. If it does, it returns the `ContID` value. If not, it returns a blank.

If you prefer to create a new table instead of a column, you can use the `FILTER` function like so:

Filtered FactTable =
FILTER(
FactTable,
CONTAINS(DimTable, DimTable[ContID], FactTable[ContID])
)

This new table (`Filtered FactTable`) will have only the rows where the `ContID` in the FactTable exists in the DimTable.

Be careful with using this kind of filtering over large data sets as it might have an impact on performance. Always test your solution in the real-world scenario to make sure it performs well.


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696
Cbutler
Helper III
Helper III

Could use a Lookupvalue calculated column? This will bring the value from one table in to the other, no relationship required. 
LOOKUPVALUE – DAX Guide

Might be, I have doubt on this

I just want to filter Id's in 2nd table for the id's which are present in 1st table

AmiraBedh
Most Valuable Professional
Most Valuable Professional

Can you please provide more details?
I already provided an answer.


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Hi,
Actually in SQL lvel I was doing Inner Join based on ID  IN fact on dim table, it's giving lot of refreshing issue
data size is like 38M, so it's taking 3.5hrs to refresh
So I need alternate sol for that

AmiraBedh
Most Valuable Professional
Most Valuable Professional

Can you please provide sample data ?


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.