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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Reference Table through Power BI - PLEASE HELP!

I am trying to build a relationship between two tables.  One of the tables was supposed to have unique values, to create a relationship.

 

Is there a way in PowerBI to take a column from a table, create a third table from the deisred column(the reference table) and distill the values down to a unique set of values?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous

 

You can easily do this in Power Query.

 

Right click Original Table, select Reference , Remove the unwanted columns, select "Remove Duplicates", now you will have the column with unique values .

 

You can use this table as Relationship / Bridge table as you needed.

 

Thanks

Raj

View solution in original post

14 REPLIES 14
v-jiascu-msft
Employee
Employee

Hi @Anonymous,

 

Could you please mark the proper answers as solutions?

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
cb_ohio
Frequent Visitor

I first createsd a table "ORDERS"

ORDERSORDERS

Next, I right click on ORDERS and select "Reference"

Reference TableReference Table 

Next I renamed the table to "INVENTORY" and grouped by "FRUIT"

GROUP.jpg

 

GROUP DIALOG.jpg 

 

Result:

RESULT.jpg

v-jiascu-msft
Employee
Employee

Hi @Anonymous,

 

A solution using DAX could be like below. Please give it a try.

Table =
FILTER (
    DISTINCT (
        SELECTCOLUMNS ( 'DimProduct', "key", CONCATENATE ( [BrandName], [ColorName] ) )
    ),
    ISBLANK ( [key] ) = FALSE ()
)

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@v-jiascu-msft

 

What is the first step in creating a new table.  It is no longer in the "Modeling" tab?

 

Can you also breakdown the components in the DAX starement so I understand the references and how to translate that to my dataset and how they apply?

 

Thanks!

Hi @Anonymous,

 

Please refer to the snapshot and the comments on the code.

Table =
FILTER (  //filter out blanks, for you want to establish relationship.
    DISTINCT (  //only keep unique values.
        SELECTCOLUMNS ( 'DimProduct', "key", CONCATENATE ( [BrandName], [ColorName] ) )
    ),  //concatenate two fileds as you mentioned. 'DimProduct' is a table while [BrandName] and [ColorName] are columns of 'DimPorduct'.
    ISBLANK ( [key] ) = FALSE ()
)

Reference_Table_through_Power_BI_PLEASE_HELP

 

 

Best Regards,

Dale

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

On the "Home" tab "Enter Data"

cb_ohio
Frequent Visitor

One quick and easy method would be to make a reference copy of one of the tables and group by the column you want distinct values for.  You can eliminate any of the other columns you don't want.

Anonymous
Not applicable

@cb_ohio

 

Can you send me some screenshots or steps...not sure I know how to do this.

Anonymous
Not applicable

Yes, you can do that way also, Both gives same result.

 

Click on the column you created, Go to Transform Tab -> Click Group by , it will create 2 columns , one is the unique value of your column and another one is based on your selection ( ex: count). You can delete the extra column and keep the custom column.

 

Thanks
Raj

Anonymous
Not applicable

Hi @Anonymous

 

You can easily do this in Power Query.

 

Right click Original Table, select Reference , Remove the unwanted columns, select "Remove Duplicates", now you will have the column with unique values .

 

You can use this table as Relationship / Bridge table as you needed.

 

Thanks

Raj

Anonymous
Not applicable

@Anonymous

 

Thanks, one last question.  To create the relationships, I am concatenating two colums.  Since this is a function, I can't seem to remove the duplicates in Power Query.  Any thoughts?

 

Thanks!

Anonymous
Not applicable

You will still get that option. Right click on the customn column you have created , you will see Remove duplicates option.

 

Thanks
Raj

Anonymous
Not applicable


@Anonymous wrote:

You will still get that option. Right click on the customn column you have created , you will see Remove duplicates option.

 

Thanks
Raj


 

 

Did you try this?

 

Remove duplicates.PNG

Anonymous
Not applicable

@Anonymous

 

There doesn't seem to be the option to remove duplicates as the column I created using the CONCATENATE function is not showing in Query Editor?

 

 

QE.JPG

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.