Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Arun_BI
Helper I
Helper I

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

Capture.PNG

 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.

Capture1.PNG

 

The desired output should be

 

Capture2.PNG

Thanks in Advance.

1 ACCEPTED SOLUTION

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])))

1.PNG2.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

11 REPLIES 11
Arun_BI
Helper I
Helper I

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:

Desired  op.PNG

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?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.

I believe you already have an answer to your question.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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])))

1.PNG2.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

@v-jayw-msft 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

Thanks @v-jayw-msft I will try this out today and let you know my results. 

amitchandak
Super User
Super User

@Arun_BI , better to create a bridge table for staff name

Bridge Table: https://www.youtube.com/watch?v=Bkf35Roman8&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=19

 

https://www.seerinteractive.com/blog/join-many-many-power-bi/

 

Satff Name =

distinct(union(distinct(Table1[Satff Name]),distinct(Table2[Satff Name])))

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 

Capture111.PNG

@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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.