Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Variable (VAR/RETURN) Not working as expected

I am trying to create a Measure in Excel but this is not working as expected. 

 

I have one fact table (which contains hire date) and one calendar table. 

 

The measure I have created is as follows:

 

My expected result is that this measure should show for each month the employees hire date as long as the calendar month is less than today's date.

 

I get this as the solution (it is incorrect because the dates are missing in subsequent months) - the result only shows up if the hire date is in the calendar table month. 

 

 

(Solution would include for employee 1 date 9/14/2021 in September 2021, October 2021, so on and so forth until today() condition is met). 

 

 

  • Anonymous , try

    var hiredate =calculate(min('employee roster'[hire date]), allexpect('employee roster') )

     

    or

     

    var hiredate =calculate(max('employee roster'[hire date]), allexpect('employee roster') )

2 Replies

  • Anonymous , try

    var hiredate =calculate(min('employee roster'[hire date]), allexpect('employee roster') )

     

    or

     

    var hiredate =calculate(max('employee roster'[hire date]), allexpect('employee roster') )

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks worked perfectly, made a tiny edit to the 'Allexpect' function by specifying column