Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
2 years ago

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 NameTotal
A90 €
B350 €

Table of students

CoursePupilCharged
ALucia30 €
AMario30 €
AIsabel30 €
BInes175 €
BGloria175 €

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

  • rubayatyasmin's avatar
    rubayatyasmin
    Community 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. 

  • 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.