Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
Hello,
i have 2 columns comes from the client for example ID1 and ID2 ( Fact Table )
i make relationship with dim_emp between (Dim_ID1) and (Fact_ID1 )
the relation workins fine for most of the agents
but i have one problem that some agents that comes from the client don't have ID1 but have ID2
so i want to tell power bi if you didn't find ID1 so make the relation with ID2
how i can make that ?
Solved! Go to Solution.
As per my understanding your data is as:
You have a Fact table that contains two ID columns from the client:
ID1
ID2
You also have a Dimension table (Dim_Emp) with the column:
Dim_ID1
Currently, you've created a relationship between:
Fact[ID1] → Dim_Emp[Dim_ID1]
This works fine for most agents.
However, for some records, ID1 is blank or missing, but ID2 has a valid value.
You want Power BI to fall back to use ID2 when ID1 is not available for establishing the relationship.
My solution to this will be create a new Calculated column the Fact table that acts as a fallback ID by checking ID1 first, and using ID2 if ID1 is blank.
In Power BI, go to your Fact table and create a new column using the below DAX:
Effective_ID = IF ( NOT ISBLANK(Fact[ID1]), Fact[ID1], Fact[ID2] )
In Model view:
Delete the existing relationship between Fact[ID1] and Dim_Emp[Dim_ID1]
Create a new relationship between:
Fact[Effective_ID] → Dim_Emp[Dim_ID1]
This ensures Power BI uses ID1 when it’s present, and falls back to ID2 otherwise.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Happy to help!
Hi @ahmedshalabyy12,
I hope you had a chance to review the solution shared by @Shivu-2000 . If it addressed your question, please consider accepting it as the solution — it helps others find answers more quickly.
If you're still facing the issue, feel free to reply, and we’ll be happy to assist further.
Thank you.
As per my understanding your data is as:
You have a Fact table that contains two ID columns from the client:
ID1
ID2
You also have a Dimension table (Dim_Emp) with the column:
Dim_ID1
Currently, you've created a relationship between:
Fact[ID1] → Dim_Emp[Dim_ID1]
This works fine for most agents.
However, for some records, ID1 is blank or missing, but ID2 has a valid value.
You want Power BI to fall back to use ID2 when ID1 is not available for establishing the relationship.
My solution to this will be create a new Calculated column the Fact table that acts as a fallback ID by checking ID1 first, and using ID2 if ID1 is blank.
In Power BI, go to your Fact table and create a new column using the below DAX:
Effective_ID = IF ( NOT ISBLANK(Fact[ID1]), Fact[ID1], Fact[ID2] )
In Model view:
Delete the existing relationship between Fact[ID1] and Dim_Emp[Dim_ID1]
Create a new relationship between:
Fact[Effective_ID] → Dim_Emp[Dim_ID1]
This ensures Power BI uses ID1 when it’s present, and falls back to ID2 otherwise.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Happy to help!
Thank you it worked apperciate your effort
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 29 | |
| 28 | |
| 26 | |
| 26 | |
| 19 |
| User | Count |
|---|---|
| 54 | |
| 48 | |
| 39 | |
| 28 | |
| 21 |