Forum Discussion

Arun_BI's avatar
Arun_BI
Icon for Helper I rankHelper I
4 years ago
Solved

Data slicing issue in Power BI

Hi All,

 

I am new to PowerBI. Can someone please help me to understand what I did wrong?

 

I have two SharePoint lists, one list has planned hours of staff and another one has the actual time of staff and both the list has project names. I have created many to many relationships using staff names. when I slice the data of any staff using staff name/project name. The Actual hours coming correctly but planned hours are not coming as expected. Attached is my relationship diagram

. 

 when I slice my data using the Staff name, I am getting the following results. which is wrong, since it is summing up my planned hours plus my team members planned hours together.

 

The desired output should be

 

Thanks in Advance.

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Arun_BI ,

     

    Create a measure to replace [Claim Hours] in the visual.

    Measure = CALCULATE(SUM('Time log'[Hours Claim]),FILTER('Time log','Time log'[Project Name] in VALUES(FTE[Project name])))

     

    Best Regards,

    Jay

11 Replies

    • Arun_BI's avatar
      Arun_BI
      Icon for Helper I rankHelper I

      Hi amitchandak ,

      Thanks for your reply. That's really nice to know about the bridge table. I have created a bridge table but still, the issue persists. I am not sure about the issue that I can only slice data from planned hours and not from actual hours. I am unable to attach my pbix file here so shared the screenshot of my relationship diagram. Is there a way that I can share my pbix file with you? Cheers 

      • amitchandak's avatar
        amitchandak
        Icon for Super User rankSuper User

        Arun_BI , You can paste sample data from excel to here. Or upload sample data on dropbox or onedrive and share link

        Do share expected output

  • Thanks amitchandak . I have copied my tables below.

     

    FTE :

    Staff nameProject nameFTE AllocatedStart DateEnd dateWeekly durationProject DurationPlanned Hours
    RoelofsCOKI1.001 February 202231 December 202240471880
    ArunCIC PMO0.201 February 202231 December 2022847376
    DanielBRII0.501 February 202230 June 20222021420
    ArunASDAF0.2524 March 202228 July 20221018180
    ArunCOKI0.2528 July 202221 December 20221021210
    KathrynCOKI1.001 February 202231 August 202240301200
    NancyBRII0.8017 February 202228 July 20223223736

     

    Time log:

     

    Staff NameProject NameHours ClaimHours Claim dateCategory
    RoelofsCOKI106/01/2022Meeting
    RoelofsCOKI1026/01/2022Meeting
    ArunCIC PMO526/01/2022Coding
    KathrynCOKI16/01/2022Meeting
    ArunASDAF1527/01/2022Coding
    ArunCOKI312/01/2022Meeting
    ArunCIC PMO426/01/2022Meeting
    ArunCIC PMO2028/02/2022Meeting
    NancyBRII1017/02/2022Meeting
    NancyBRII129/03/2022Coding
    DanielBRII1516/02/2022Coding
    RoelofsCOKI1027/01/2022Coding

     

    The desired output will be: 

    When I select staff name and project name in the slicer both planned and actual hours should vary accordingly. Currently planned hours are varying and actual hours remain constant:

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Arun_BI ,

       

      Create a measure to replace [Claim Hours] in the visual.

      Measure = CALCULATE(SUM('Time log'[Hours Claim]),FILTER('Time log','Time log'[Project Name] in VALUES(FTE[Project name])))

       

      Best Regards,

      Jay

      • Arun_BI's avatar
        Arun_BI
        Icon for Helper I rankHelper I

        Anonymous Thanks Mate, I am able to achieve my desired results by creating a measure. Thank you so much for the help and thanks to all the community members

    • Ashish_Mathur's avatar
      Ashish_Mathur
      Icon for Super User rankSuper User

      Hi,

      Wouldn't you also want to have a slicer for selection of Month and Year.  If yes, then which column of the FTE table should the Year/Month column slice? - Start Date or End Date or both?  So if you select March 2022, what result do you expect to see for planned hours?

      • Arun_BI's avatar
        Arun_BI
        Icon for Helper I rankHelper I

        Hi Ashish_Mathur Thanks for showing interest in the post. You are right, I want to slice the data by Month & Year as well. I will use Timelog "Claim date". If I select March 2022, how many hours each staff entered on the month of March plus their planned hours will be displayed. Please let me know if you have any questions, i am happy to elaborate if needed.