Problem using Measure as Criteria inside Filter

azbasketcat

New Member
Joined
Feb 20, 2010
Messages
30
I am trying to use a disconnected slicer to find the hourly rate of an employee that is less than or equal to the max date selected in the slicer.

I can get one formula to work, but when I try and shorten it, by replacing the second Calculate with a measure, I get the incorrect value. Are there certain times that you cannot use measures inside a Filter Expression? It seems like sometimes it works and other times it doesn't.

I can get the following to work:

[Applicable Hourly Rate] =
CALCULATE (
[Max Hourly Rate],
FILTER (
EMPLOYEE_SALARIES,
EMPLOYEE_SALARIES[EFFDT] =
CALCULATE (
MAX ( EMPLOYEE_SALARIES[EFFDT] ),
FILTER ( EMPLOYEE_SALARIES, EMPLOYEE_SALARIES[EFFDT] <= [Max Selected Date] )
)
)
)

But, I cannot get the following to work:

[Applicable Hourly Rate] = CALCULATE (
[Max Hourly Rate],
FILTER (
EMPLOYEE_SALARIES,
EMPLOYEE_SALARIES[EFFDT] = [Max Effective Date in Employee_Salaries]
)
)

where

[Max Effective Date in Employee_Salaries] =
CALCULATE (
MAX ( EMPLOYEE_SALARIES[EFFDT] ),
FILTER ( EMPLOYEE_SALARIES, EMPLOYEE_SALARIES[EFFDT] <= [Max Selected Date] )
)


FYI –
[Max Hourly Rate] = MAX(EMPLOYEE_SALARIES[HOURLY_RT])
[Max Selected Date] = MAX(Date[DT])

Thanks for any thoughts. Randy
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,214,927
Messages
6,122,309
Members
449,080
Latest member
jmsotelo

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