Forum Discussion

ki's avatar
ki
Frequent Visitor
5 years ago
Solved

Help Needed w/ Data Model :-(

Hello community,

 

Hope you can help me out as I invested a lot of energy in this and couldn't get this working 😞 Still fairly new to Power BI modeling. The scenairos is the following - I hava a dataset froming from e-learning platform and want to be able to manually assign employees (or roles) to specific set of learnings and track their progress with it. The following tables are available:

- Employees Master Data - holds data like name, e-mail (this is unique identifier), country, job title, etc

- Fuse Status Data - holds data on the status of each learning plan (LP) that an employee is registered on - not started, in progress, completed; along with unique ID of the LP and some other data; have also created a few KPIs here

- Mapping - this is where I am manually creating the so-called success plans (SP) - pretty much saying that SP has an ID and then holds certain LPs

- The connections are as follows: many-to-many on SP ID and then one-to many on LP ID

 

Once I try to create a view for a specific employee on getting status, I get rows for each LP part of the SP duplicating every possible status instead of having one row per LP holding the real status.

 

Adding a few screenshots.

 

Hope you can help me out - I am sure this is very simple and I am missing something!

 

Kiril

 

  • ki 

    Ok, so here is the model for the sample data you provided. 

    I take it that what you are trying to achieve is a table showing employees who are in the success plan, correct?

    If so, we need a measure which will filter the learning plan table to show only the learning plan IDs included in the success plan table. We can then filter the learning plan status to show only these LP IDs and see the corresponding employees

    The measure we need is:

     

    SP to LP IDs =
    COUNTROWS (
        CALCULATETABLE (
            VALUES ( 'learning-plans'[LP ID] ),
            RELATEDTABLE ( 'success-plans' )
        )
    )

     

    We can now set up the visual using:

    Learning plan [LP Name] (I'm using 'Learning plan[LP ID] because it´s easier to see what's going on)
    Role [Employee Role]
    Employee [Employee Name]
    Learning status [LP status]

    Select the visual, and add the [SP to LP IDs] measure in the "filters for this visual" in the filter pane and set the value to 1.

    And you get this:

     If you only want to show the "completed" status, just use the field in the filter pane (or use a slicer):

     

    I've attached the sample PBIX file for your reference

     

     

     

10 Replies

  • PaulDBrown's avatar
    PaulDBrown
    Community Champion

    ki 

    I would wager the culprit is the many-to-many relationship. To avoid this, create a dimension table (select New Table in the ribbon) for the SP ID using the following:

     

    Dimension SP ID = DISTINCT(
                        UNION(VALUES(mapping[SP ID]), VALUES(Employees Master Data[SP ID))
                      )

     

    Now delete the many-to-many relationship and create a one-to-many relationship between the Dimension SP ID table field and the corresponding fields in both tables.
    You should now use the 'Dimension SP ID' [SP ID] field from the dimension table in your visuals, filters, filter expressions in measures etc..

    See if that solves the issue.

    • ki's avatar
      ki
      Frequent Visitor

      Thanks for the quick reply!

       

      Created the table, but when I tried then to create relationship b/n SP ID in the new table to SP ID in the existing tables I get circular dependency error 😞