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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
Planet3000
Frequent Visitor

Show TImesheet lines where Timesheet Nbr matches all Timesheet Nbrs for a Project's Approved Lines

Question:

How to identify , in Power BI Table Visual, all timesheet lines that are blocking Approved timesheet lines from Posting?

The Table visual will display all TImesheet lines for all projects where Timesheet Nbr matches all Timesheet Nbrs for a Project's Approved Lines

 

There is a table with timesheet lines with columns Timesheet Number, Project Name, Timesheet Line Status, Hours, Emp Id.

 

Timesheet Line Status can have the value 'Draft', 'In Review', 'Returned', Approved' or 'Posted'.

On a single timesheet (unique TImesheet Number), there can be several timesheet lines entered.

 

When all timesheet lines on a timesheet have all been Approved, then Line Status updates to Posted otherwise the Line Status will depend on whether the timesheet line has been submitted, approved or rejected.  

 

How do I achieve the outcome whereby selecting e.g. Project A in a slicer [Project Name] will display in a table visual all non-posted lines for all projects (where Timesheet Line Status is any status except for Posted) where the TImesheet number for Project A's Approved lines matches TImesheet number for any other project?

8 REPLIES 8
Planet3000
Frequent Visitor

Desired Outcome: When a particular project, say "Green" is selected in the slicer, then the table visual should be filterd to only show Approved Timesheet Line Status for project Green AND all timesheet lines for all other projects which share the same Timesheet Number as an Approved line for the selected Project.

 

So the Table above would have:

- timesheet line TS-0002 for project 0004-K , Red, filtered out as it is Approved for another project and not blocking Green project lines from being Posted.

- timesheet line TD-0003 for project 0001-M , Green, filtered out as it is Posted.

Hi @Planet3000 ,

Thanks for reaching out to the Microsoft fabric community forum. 

 

Please follow below steps:

1. Create a slicer on Proj Name — users select the project (e.g., Green).
2. Create a calculated table or use DAX logic to identify Timesheet Nbrs that are blocking posting for the selected project.


A. Create a measure:

ApprovedTimesheetNbrsForSelectedProject =
CALCULATETABLE (
VALUES ( TSTable[Timesheet Nbr] ),
TSTable[Timesheet Line Status] = "Approved",
TSTable[Proj Name] IN SELECTEDVALUE(TSTable[Proj Name])
)

Note: This gives you the Timesheet Nbrs where the selected project has an Approved line.

B. Create another measure: ShowFlag

ShowBlockingLines =
VAR SelectedProject = SELECTEDVALUE(TSTable[Proj Name])
VAR TimesheetsWithApprovedSelectedProject =
CALCULATETABLE (
VALUES (TSTable[Timesheet Nbr] ),
TSTable[Proj Name] = SelectedProject,
TSTable[Timesheet Line Status] = "Approved"
)
VAR IsInRelevantTimesheet =
TSTable[Timesheet Nbr] IN TimesheetsWithApprovedSelectedProject
VAR IsNotPosted = TSTable[Timesheet Line Status] <> "Posted"

RETURN
IF ( IsInRelevantTimesheet && IsNotPosted, 1, 0 )

C. Use this in your Table Visual: Add all your columns (Timesheet Nbr, Line Status, Proj ID, etc.). Apply a visual-level filter: ShowBlockingLines = 1.

 

If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thanks and Regards

 

Hi @Planet3000 ,

If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

Thank you

Hi @Planet3000 ,

If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

Thank you

Hi @Planet3000 ,

If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

Thank you

Sample Data:

 

Timesheet NbrTimesheet Line StatusProj IDProj NameProjTransDateHoursEmp IDEmp Name
TS-0001Approved0001-MGreen1/04/20244E001Jo Smith
TS-0001In Review0002-DYellow2/04/20243E001Jo Smith
TS-0001In Review0003-MBlue3/04/20242E001Jo Smith
TS-0002Approved0001-MGreen4/04/20245P002Jamie Walker
TS-0002Returned0002-DYellow5/04/20248P002Jamie Walker
TS-0002Approved0004-KRed6/04/20246P002Jamie Walker
TD-0003Posted0001-MGreen6/03/20244E001Jo Smith
Planet3000
Frequent Visitor

 

Query

How to identify , in Power BI Table Visual, all timesheet lines that are blocking Approved timesheet lines from Posting?

Issue:

On a Timesheet, employees enter line with hours worked per project per week.

The Timesheet Line status can be either Draft, In Review, Returned, Approved or Posted.

Only when all timesheet lines on a timesheet are Approved will the status for all lines be updated to Posted.

 

 

Need to identify for a particular project, using a slicer to select ProjectName, what are all the timesheet lines on the same timesheet number where there is an Approved timesheet line for that particular project.

 

Data Table (Table Name: TSTable)

 

Timesheet NbrTimesheet Line StatusProj IDProj NameProjTransDateHoursEmp IDEmp Name
TS-0001Approved0001-MGreen1/04/20244E001Jo Smith
TS-0001In Review0002-DYellow2/04/20243E001Jo Smith
TS-0001In Review0003-MBlue3/04/20242E001Jo Smith
TS-0002Approved0001-MGreen4/04/20245P002Jamie Walker
TS-0002Returned0002-DYellow5/04/20248P002Jamie Walker
TS-0002Approved0004-KRed6/04/20246P002Jamie Walker
TD-0003Posted0001-MGreen6/03/20244E001

Jo Smith

Ritaf1983
Super User
Super User

Hi @Planet3000 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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