cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dirkmuis Helper II
Helper II

Create relations in the database or in powerBI

For my reports I obviously need to combine data. But what is the best practise on doing so?

For instance, I have a table

Cars

-Name

-Type

-Fuel

-Gearing

-ManufacturerID

and

Manufacturers

-ID

-Name

-Adres

-Country

 

I could for instance create a view which results in a table which contains all data. 

So I grab all cars from Cars and join them with Manufactureres on the ID. This means I have the name of the Manufacturer multiple times in the result.

 

I can also create one table with only the Cars data I need and the Manufacturers ID. I also create a table with the ManufacturersID and Name because that's all I need. This means I always export all Manufacturers to powerBI because I join them within powerBI. So useless Manufacturers without cars are also exported.

 

Which one is the best way forward? Am I right to say that this depends on the scenario? So if there are 400k card and 12 manufacturers you're repeating their names 400k times while you can also send them out all 12 at once.

2 REPLIES 2
Microsoft
Microsoft

Re: Create relations in the database or in powerBI

Hi @dirkmuis 

 

You may try to create relationships in power bi.Below are some articles for your reference.If you need further help,you may share some data sample and expected output. You can upload the .pbix file to OneDrive and post the link here. Do mask sensitive data before uploading.We could show you how to create the relationships.

https://docs.microsoft.com/en-us/power-bi/desktop-create-and-manage-relationships

http://radacad.com/what-is-the-direction-of-relationship-in-power-bi

 

Regards,

Cherie

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

Re: Create relations in the database or in powerBI

@v-cherch-msft 

please check this pbix:

https://1drv.ms/u/s!AktsOVneXVdRjL1Uk7fJGFCWgMl-lg

 

As you can see, when you view as role RLS all tables are correctly filtered except the course table. 

So the only solution would be joining them in de database already and work with flat tables in powerBI?

 

To give you an idea:

The coursegroup table had over 1,2M records, as the course table has 300k.

 

So I joined the course table to be able to join e.g. the names. In that case I'm able to export the names only 300k times and not 1,2M times with a lot of doubles.

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ Integration Forum Launch

‘Better Together’ Integration Forum Launch

We've launched a how-to forum where you can learn about how Power BI integrates with other Power Platform products.

Top Solution Authors
Top Kudoed Authors