Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Request Help with Creating a Report using different tables

Dear All,

I request your Help in creating a report from different tables.

I have six tables namely BusinessCategories, BusinessPermits, BusinessRolePermit, BusinessRoles, BusinessUserRoles, & BusinessUsers as my input. Using these tables, I have to create a report (expected columns in this report is shown at the end)

 

BusinessCategories

Business IDBusiness Category
NY101Person
NY102Mail Form
NY103Application
NY104Accounts

 

BusinessPermits

Permit ID PermitBusiness ID
100Enter Person Module (Read-only)NY101
200Edit a PersonNY101
300Delete a personNY103
400Enter Member Company Module (Read-only)NY104
500Edit a companyNY103

 

BusinessRolePermit

Role IDPermit ID
XBXY-987V-A678-HLFJSFSA6100
GFHY-837F-F725-LIPGSTFSL2500
XBXY-987V-A678-HLFJSFSA6200
LPAR-298R-U364-LPSRKHVY5500

 

BusinessRoles

Role IDRoles Description 
XBXY-987V-A678-HLFJSFSA6GuestRead-Only Access
GFHY-837F-F725-LIPGSTFSL2AdminRead Write Access
JKSP-567W-J275-KSPFNXMT8UserRead-Only Access
LPAR-298R-U364-LPSRKHVY5Super UserRead-Only Access

 

BusinessUserRoles

Role IDUser ID
XBXY-987V-A678-HLFJSFSA6A00201
GFHY-837F-F725-LIPGSTFSL2A00202
JKSP-567W-J275-KSPFNXMT8A00203
GFHY-837F-F725-LIPGSTFSL2A00204

 

BusinessUsers

User IDNameLogin
A00201Raghav Vellankirvellanki
A00202Jason PetersonJpeterson
A00203Alan KingAking
A00204Mark WaughMwaugh

 

The expected output report should have the following columns:

Role IDRolesDescriptionPermitBusinessCategoryPermit IDNameLogin
XBXY-987V-A678-HLFJSFSA6GuestRead-Only AccessEnter Person Module (Read-only)Person600Raghav Vellankirvellanki
GFHY-837F-F725-LIPGSTFSL2AdminRead Write AccessEnter Person Module (Read-only)Person500Jason PetersonJpeterson
JKSP-567W-J275-KSPFNXMT8GuestRead-Only AccessEnter Person Module (Read-only)Person500Alan KingAking
LPAR-298R-U364-LPSRKHVY5GuestRead-Only AccessEnter Member Company Module (Read-only)Member Company600Mark WaughMwaugh

 

The relationships that I built could only retrieve till column PermitID. When I try to pull data for 'Name' and 'Login' columns (.i.e. from BusinessUserRoles Table and BusinessUsers. table) I am getting an error message "Can't determine relationships between the fields". I am not sure where I went wrong, Did I build the relationships wrong or the data model is wrong?

 

 

Error MessageDataModel 

 

 

 

 

  • Hi Anonymous,

     

    The table "BusinessRolePermit" could be redundant. Try it like below.

    Request_Help_with_Creating_a_Report_using_different_tables

    There seems some errors in your relationship.

    Data_Model

     

    Best Regards,

    Dale

  • Hi Rnagalla,

     

    I afraid your mode isn't the best practice in Power BI. Please check out the demo here. Just like in the Data warehouse, one (or many) fact table with many dimension tables. 

    1. Merge two tables to get a fact table. 

     

    1

    2. Recreate the relationships. It's a star relationship. If we want to see the details, we can add the dimensions. 

    2

    3. Almost all the fields can be added into the table visual now.

     

     

    Best Regards,

    Dale

4 Replies

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Microsoft Employee

    Hi Anonymous,

     

    The table "BusinessRolePermit" could be redundant. Try it like below.

    Request_Help_with_Creating_a_Report_using_different_tables

    There seems some errors in your relationship.

    Data_Model

     

    Best Regards,

    Dale

    • Anonymous's avatar
      Anonymous
      Not applicable

      Dear v-jiascu-msft

       

      Thank you so much for responding to my query. I have tried using the data model you suggested. However I am recieving a error in relationship.

       

      When I merge "Permit ID" column from "BusinessRolesPermit" table to "BusinessRoles" table, the "RoleID" column which has unique values earlier is now getting duplicate values. The "RoleID" column in "BusinessUserRoles" table already has duplicate values. Hence I am recieving a error message, while trying to build relationship between "BusinessRoles" table and "BusinessUserRoles" table.

       

      Old BusinessRoles Table

      Role IDRoles Description 
      XBXY-987V-A678-HLFJSFSA6GuestRead-Only Access
      GFHY-837F-F725-LIPGSTFSL2AdminRead Write Access
      JKSP-567W-J275-KSPFNXMT8UserRead-Only Access
      LPAR-298R-U364-LPSRKHVY5Super UserRead-Only Access

       

      New BusinessRoles Table (after merging Permit ID)

      Role IDRolesDescriptionbusinessrolepermits.Permit ID
      XBXY-987V-A678-HLFJSFSA6GuestRead-Only Access100
      XBXY-987V-A678-HLFJSFSA6GuestRead-Only Access200
      GFHY-837F-F725-LIPGSTFSL2AdminRead Write Access500
      LPAR-298R-U364-LPSRKHVY5Super UserRead-Only Access500
      JKSP-567W-J275-KSPFNXMT8UserRead-Only Access 

       

      Error Message Screenshot

      Please suggest on how to overcome this error. Appreciate all your support. I can't really stress enough on how much your response helped me. Thank you again.

       

      Rnagalla.

      • v-jiascu-msft's avatar
        v-jiascu-msft
        Microsoft Employee

        Hi Rnagalla,

         

        I afraid your mode isn't the best practice in Power BI. Please check out the demo here. Just like in the Data warehouse, one (or many) fact table with many dimension tables. 

        1. Merge two tables to get a fact table. 

         

        1

        2. Recreate the relationships. It's a star relationship. If we want to see the details, we can add the dimensions. 

        2

        3. Almost all the fields can be added into the table visual now.

         

         

        Best Regards,

        Dale