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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
slanka
Helper I
Helper I

Filter Group By in Same table

Friends,

 

I have data in one single table, Table A, in the below format,

 

EmpNameProjNameTimesheetDate
Emp1Proj11-Jul-19
Emp1Proj12-Jul-19
Emp1Proj13-Jul-19
Emp1Proj15-Jul-19
Emp1Proj18-Jul-19
Emp1Proj29-Jul-19
Emp1Proj210-Jul-19
Emp1Proj211-Jul-19
Emp1Proj212-Jul-19
Emp1Proj215-Jul-19
Emp1Proj216-Jul-19
Emp1Proj217-Jul-19
Emp1Proj218-Jul-19
Emp1Proj219-Jul-19
Emp1Proj324-Jul-19
Emp1Proj325-Jul-19
Emp1Proj326-Jul-19

 

I need to filter that data and get the MinDate and MaxDate per Employee, Per Project (everything is in the same table, tried creating Calculate(Min(Timesheedate),Filter(TableA,Groupby(empname)), it's giving circular dependency error).

 

Final expected output should be,

 

EmpNameProjNameMinDateMaxDate
Emp1Proj11-Jul-198-Jul-19
Emp1Proj29-Jul-1919-Jul-19
Emp1Proj324-Jul-1926-Jul-19

 

Need help!

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

Drag EmpName and ProjName on to a table visualisation.

Then drag TimeSheetDate on to the same table twice.

In the Values field well, click the dropdown on the first TimeSheetDate, choose Earliest.

Click the dropdown on the secondTimeSheetDate, choose Latest.

You can change the date format by choosing TimeSheetDate instead of Date Hierarchy from the same dropdown.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @slanka 

Here is my solution

Create 3 new columns:

Column MAX = 
CALCULATE ( MAX ( T15[TimesheetDate] ), ALLEXCEPT ( T15, T15[EmpName],T15[ProjName] ) )
Column Min = 
CALCULATE ( MIN( T15[TimesheetDate] ), ALLEXCEPT ( T15, T15[EmpName],T15[ProjName] ) )
NOT Mandatory, just for debugging
MIN_MAX = IF(T15[Column MAX] = T15[TimesheetDate] || T15[Column Min] = T15[TimesheetDate], 1,0)

Create a new table:

T16 = 
SUMMARIZE(T15,T15[EmpName], T15[ProjName], T15[Column MAX],T15[Column Min])

2019-07-19 09_31_44-papercut - Remote Desktop Connection.png

 

Good Luck!
A

HotChilli
Super User
Super User

Drag EmpName and ProjName on to a table visualisation.

Then drag TimeSheetDate on to the same table twice.

In the Values field well, click the dropdown on the first TimeSheetDate, choose Earliest.

Click the dropdown on the secondTimeSheetDate, choose Latest.

You can change the date format by choosing TimeSheetDate instead of Date Hierarchy from the same dropdown.

Thanks for the trick 🙂 it worked!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.