Forum Discussion

mjmm's avatar
mjmm
Frequent Visitor
2 years ago
Solved

Adding missing rows to my dataset

Dear all,  I am new to PowerBI and I have a question I hope someone can help me with. Thanks inadvance for any help I will receive, it's much appreciated.  I have the following (example) datase...
  • Gabry's avatar
    2 years ago

    Hello Mark, 
    You need to modify your model I suppose. Do you have just one table?

    You need to create a new table with the team members, like this:

     

    TeamMembers = SUMMARIZE(
       'Table',
        'Table'[Name],
        'Table'[Team]
    )

    Then you need to connect the teammembers table to the original table by names
    Then create the formula: Total Hours = SUM('Table'[Hours])

    Then use the TeamMembers table as the basis for your table visualization. Include the Name, Team, and your Total Hours measure.

    Then in the table visualization settings, ensure that "Show items with no data" is enabled for the Name field.



    If this helps pls accept the solution and kudos 😉

    PS. 

    Since the relationship with the `Name` field is obviously weak, you might need to consider adding IDs

  • AnkitaaMishra's avatar
    2 years ago

    Hi mjmm , Hope you are doing well.

    Please follow below steps for your requirement : 
    Step 1 : Create a summarize table with Name, Team and Concat columns as shown below :

    Step 2 : Create a concatenated column using Name and Team column in your original table to build relationship between summarized table and original table : 

    Step 3 : Build a measure with below DAX for calculating hours : 

    TotalHours =
    Var tHours = CALCULATE(
        SUM('Table'[Hours]),
        ALLSELECTED('Table'[Projectcode])
    )
    RETURN
    IF(
        ISBLANK(tHours),
        0,
        tHours
    )
    Below is the output of above steps :


    Let me know if this works for you else share more details about your requirement

     

    Thanks,

    Ankita