Forum Discussion
yaman123
Post Partisan
5 years agoEmployee Promotions
Hi, I need help with a query to show employee promotions within a selected month. I have a date table which is used as a slice to show data for that month. MAX(date) is used. I have a ...
- Anonymous5 years ago
Hi yaman123 ,
So you can do some steps as follows.
1. create a "Month" column in table "Date".
month = MONTH('Date'[Date])2. create a measure and drag it into the filter of the table visual. (is 1)
Measure =
var x1=SELECTEDVALUE('Date'[month])
var x2=MAXX('Table 3',MONTH('Table 3'[FROM DATE]))
return
IF(x2>=x1-6&&x2<=x1,1,0)Result:Hope that's what you were looking for.
Best Regards,
Yuna
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
yaman123
Post Partisan
5 years agoHi amitchandak
I have the below dataset. The Valid To can be blank if the employee is still with the company.
| EMP NO | NAME | JOB TITLE | VALID FROM | VALID TO |
| 1001 | A | MANAGER | 19/05/2020 | 31/12/9999 |
| 1002 | B | HR MANAGER | 01/08/2012 | 31/07/2020 |
| 1002 | B | HR BUSINESS PARTNER | 01/08/2020 | 31/12/9999 |
| 1003 | C | AP TEAM LEADER | 05/01/2020 | 31/12/9999 |
| 1004 | D | ADMINISTRATOR | 01/10/2019 | 31/10/2020 |
| 1004 | D | CONTRACT MANAGER | 01/11/2020 | 31/12/9999 |
I would like to show the below when e.g August 2020 is selected:
| EMP NO | NAME | OLD ROLE | NEW ROLE | FROM DATE |
| 1002 | B | HR MANAGER | HR BUSINESS PARTNER | 01/08/2020 |
I have a date table which is used to select the month year and this isnt linked to any tables. I use MAX(DATE) in the measures to pull the data for that period.