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
userdata
Helper IV
Helper IV

Dynamic join of three different column which are not blank

Hi,

 

I have two 3 different ids and I need to do a dynamic join based on the column that are not null. 

This is one table where different notes are stored and looks like this;

 

Table1

id1  id2  id3  notes

3                     deded

        2

                7

4       5     8

 

 

fact

id1 id2 id3 sales

3     3     2   5

 

So the fact table has all ids and there is no blanks in there. In the table1 there can be nulls and i want to join table1 on fact based on what is not null in table1 : like  if id2 is the only one that has a value , then join only id2 on fact, if id1 has only a value then join id1 on the fact etc. How is this possible?

1 ACCEPTED SOLUTION

I would recommend you set up the model with dimension tables for common fields in both tables. You can the use the fields from the dimension tables in visuals, measures, slicers, filters etc....

Model.JPG

 

Visuals.JPG

 

I've attached the sample PBIX file





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

6 REPLIES 6
v-xiaoyan-msft
Community Support
Community Support

Hi @userdata ,

 

I'm not quite sure if I understand your needs accurately.
Sample data without sensitive information and expected output would help tremendously.
Please see this post regarding: 

How-to-Get-Your-Question-Answered-Quickly 

How-to-provide-sample-data-in-the-Power-BI-Forum 

 

Hope it helps,


Community Support Team _ Caitlyn

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

 

PaulDBrown
Community Champion
Community Champion

Where is Sales coming from?

Are each IDs different dimensions or are they the same dimension listing different values?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






@PaulDBrown  these are different dimensions but all coming from the same table

OK. Can you elaborate on what you are expecting to achieve? I don't quite understand what the expected output should be. Perhaps recreate an example of the output in Excel and post the depiction?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






I just uploaded the file here https://github.com/userdata21/test/blob/main/Dynamic_Join.pbix

 

So in fact we have all ids and entities. What we want to bring to the table visual is to see the notes but based on a dynamic join. The user can in Table 1 either only put iD and a notes , or a name and a comment, or can put an ID, ID2,Name and notes alltogehter based upon that the notes are only to be seen at ID level or ID2 level etc. Im not sure how to change the merge or join based on the different conditions as in the fact all ID, ID2 and name will be will be always there but in tavble 1 there can be blanks but not in fact

I would recommend you set up the model with dimension tables for common fields in both tables. You can the use the fields from the dimension tables in visuals, measures, slicers, filters etc....

Model.JPG

 

Visuals.JPG

 

I've attached the sample PBIX file





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






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.