using measure to filter table

ajm

Well-known Member
Joined
Feb 5, 2003
Messages
2,056
Office Version
  1. 365
Platform
  1. Windows
hi folks, i want to filter my data table for active projects using a measure that counts all active projects. My measure, "Active Projects", compares the start and end date selected by users on a slicer to the start and end dates of the projects listed in the table. listed. Where the dates line up, that project is deemed to be active. and is counted into the total Active Projects number. so that is a single number.

Power Query:
Active Projects = 
VAR SelectedStartDate = MIN('ExtXLFileDates'[Date])
VAR SelectedEndDate = MAX('ExtXLFileDates'[Date])
RETURN
CALCULATE(
    DISTINCTCOUNT('ForwardPlan'[Description]),
    FILTER(
        'ForwardPlan',
        ('ForwardPlan'[Activity Start] <= SelectedEndDate && ('ForwardPlan'[Activity End] >= SelectedStartDate))
       ||('ForwardPlan'[Activity Start] >= SelectedEndDate && ('ForwardPlan'[Activity End] <= SelectedStartDate))
   ||('ForwardPlan'[Activity Start] < SelectedStartDate && 'ForwardPlan'[Activity End] <= SelectedEndDate && ('ForwardPlan'[Activity End] >= SelectedStartDate)) 
    ||('ForwardPlan'[Activity Start] > SelectedStartDate && 'ForwardPlan'[Activity Start] <= SelectedEndDate && ('ForwardPlan'[Activity End] >= SelectedEndDate)) 
    ))

I want to filter my data for these Active projects. How can this be done?
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Add a table to the canvas
Add some columns (ie project number, desc)
Add the measure you wrote to the table. It will only show the projects that are in your date range
 
Upvote 0

Forum statistics

Threads
1,224,812
Messages
6,181,096
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top