Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Relationship between tables

Hi Power BI Super Community,

 

I am unable to establish a relationship between my tables. I have tried using a star schema. A fact table and the dim tables.

 

However, the star schema does not work as expected with a filter in the CA#1 tab.

 

Below is the PBIX file. Fingers crossed that the link works.

 

Tutoring Only_V2.pbix

 

Thank you for any nudge you are able to provide.

 

Luis

  • Hi,

    i just download the file which you shared with me on Satuday and the calculated formula which i suggested to you is already there.  I downloaded and opened that file - everything is just fine and there are no filters on the scatter plot visual.

12 Replies

  • Hi,

    Your requirement is not at all clear.  From the looks of it, Student ID is the common column in all tables.  Create a many to one relationship from 3 tables to 1 master table (the 1 master table is the one which has all ID's without repetitions). 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Ashish_Mathur 

       

      I've updated my model per your suggestion.

       

      Tutoring Only_V2.pbix

       

      The issue is that when I make Teacher-Student the fact table, I get an error for the scatterplot in tab Tutoring. Please see tab. The error is that no relationship exists. Under this situation, the scatterplot only displays if I sum tutor hours. I don't want to summarize. 

       

      However, if I make a relationship between CA#1 and Tutor Hours by Sessions, the filter for Session Weeks (Group) does not activate.

       

      In sum, I want the to achieve the following.

       

      1. Display scatter plot by non-summarize CA#1 Scores and non-summarized Tutor Hours

      2. Have a Session Weeks (Groups) Filter for both the column chart and the scatter plot on Tutoring tab.

       

      But my current relationship model is not working as intended.

       

      Please let me know if you have any questions.

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Super User

        Hi,

        I still do not understand what you want but from whatever i can see if this is any helpful.  Bring over the hours from the Tutorial log_long table to the CA table with this calculated column formula

        Column = CALCULATE(SUM('Tutorial Log_Long'[Total Hours]),FILTER('Tutorial Log_Long','Tutorial Log_Long'[Student ID]=EARLIER('CA #1_Long'[Student ID])))

        To your scatter plot visual, drag this column to the X-axis.