Forum Discussion
Doubt about relationships.
Good morning:
I'm a Nobel Power BI user and there's something that leaves me off balance.
In SQL, when you relate two tables, the results obtained may be duplicated. For example:
Table with Courses
| Course Name | Total |
| A | 90 € |
| B | 350 € |
Table of students
| Course | Pupil | Charged |
| A | Lucia | 30 € |
| A | Mario | 30 € |
| A | Isabel | 30 € |
| B | Ines | 175 € |
| B | Gloria | 175 € |
I relate the two tables in GDP, by the course field from one to many.
I make a filter by course, for example A, if I add up the totals of the courses it gives 90 €, if I do it from what I charge it also gives 90 €.
If you did it in SQL, the total of course A would be €270 (90 x3) and the total charged would be €90.
Do I have a bad relationship in GDP? Or does GDP natively not add up the duplicate results?
What the GDP gives me is magnificent, but I need to understand if what I perceive is correct or not.
Thank you very much, I hope I have explained my doubt.
2 Replies
- rubayatyasminCommunity Champion
Hi, Syndicate_Admin
I think you are facing PBI Native aggregation related issue. the relationship seems okay given the data. If you want to replicate the SQL behaviour in PBI you might want to change the default agg func. by deafult PBI sums the rows.
- Syndicate_AdminAdministrator
Hello
Would the aggregations first be grouped according to the criteria indicated and then the relationship is made on the data obtained?
If you wanted a behavior like SQL, would you have to remove the aggregations you've generated by default?
Thank you very much for your time.