powered by
Defines a relationship between tables in a Power BI push dataset. To add this definition to a Power BI dataset schema, use pbi_schema_add_relations().
pbi_schema_relation_create( from_table = NULL, from_column = NULL, to_table = NULL, to_column = from_column, direction = c("OneDirection", "BothDirections", "Automatic"), name = paste0(from_table, to_table, from_column) )
A data.table
The name of the foreign key table
The name of the foreign key column
The name of the primary key table
The name of the primary key column. Defaults to from_column
The filter direction of the relationship. Defaults to 'OneDirection'
The relationship name and identifier. Defaults to a concatenation of from_table, to_table and from_column
# An example
Run the code above in your browser using DataLab