Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello,
I am having a issue, maybe you can help.
I have vacancy data set, that consists of vacancy reference number (post_number), when vacancy was advertised and when vacancy was completed.
I want to count number of roles for vacancies that were open during selected period.
For example, if I am looking on month July, I should see all vacancies that were open during that month following conditions:
Completed date is greater then or equals to July or blank (as still open);
Vacancy authorised date is before or equals to July.
I am using Date table to filter by month July and I can see only records with completed date July, but there should be as well records where vacancy was authorised in May, Completed in August, so it was open during July.
I have two tables and both are joined with active relationship between Date table, Date column & Vacancies table, Completed date.
This is the dax code for measure that I am using. You will notice that there are 2 conditions, to switch roles from 99 to 1 and to not include those vacancies with 16.06.2023 - that's all fine and it should be like that.
Open Roles = CALCULATE( SUMX('Vacancies', IF('Vacancies'[number_of_positions] = 99, 1, 'Vacancies'[number_of_positions])), FILTER( 'Vacancies', ( 'Vacancies'[Completed_date] >= MIN('Date'[Date]) && -- Filters out vacancies with a 'Completed_date' greater than or equal to the minimum date in the 'Date' table 'Vacancies'[Completed_date] <> DATE(2023, 6, 16) && -- Filters out vacancies with a 'Completed_date' equal to June 16, 2023 'Vacancies'[Completed_date] >= MIN('Date'[Date]) - 60 // Modify this line to include July or later ) || ISBLANK('Vacancies'[Completed_date]) // Includes vacancies with a blank 'Completed_date' ), 'Vacancies'[Vacancy_authorised_date] <= MAX('Date'[Date]), // Filters out vacancies with a 'Vacancy_authorised_date' greater than the maximum date in the 'Date' table 'Vacancies'[Vacancy_authorised_date] <> BLANK() // Filters out vacancies with a blank 'Vacancy_authorised_date' ) |
This is the result that I get:
This is the result that I am expecting to have:
Clearly it takes into account only those vacancies where Completed date is July only even though I have conditions set in measure.
Can you please advise?
I have the same issue with other dashboards, like absence etc.
Below is data set that I have.
Post_number | Job_description | Vacancy_authorised_date | Completed_date | Advertised | Advertised_until | Closing_date | Number_of_positions |
255 | Vacancy 255 | 31-Mar-23 | 16-Jun-23 | 16-Mar-23 | 02-May-23 | 02-May-23 | 1 |
178 | Vacancy 178 | 16-Jun-23 | 06-Dec-21 | 08-Dec-21 | 08-Dec-21 | 1 | |
298 | Vacancy 298 | 30-Jan-23 | 23-Jun-23 | 20-Apr-23 | 19-Jun-23 | 19-Jun-23 | 1 |
33 | Vacancy 33 | 16-Jun-23 | 25-Jun-23 | 1 | |||
20 | Vacancy 20 | 26-May-23 | 27-Jun-23 | 31-May-23 | 23-Jun-23 | 23-Jun-23 | 1 |
320 | Vacancy 320 | 27-Apr-23 | 28-Jun-23 | 09-May-23 | 05-Jun-23 | 05-Jun-23 | 1 |
288 | Vacancy 288 | 30-Mar-23 | 05-Jul-23 | 1 | |||
250 | Vacancy 250 | 18-Jan-23 | 06-Jul-23 | 19-May-23 | 19-Jun-23 | 19-Jun-23 | 1 |
264 | Vacancy 264 | 16-Feb-23 | 06-Jul-23 | 01-Mar-23 | 16-Mar-23 | 16-Mar-23 | 1 |
23 | Vacancy 23 | 31-May-23 | 06-Jul-23 | 09-Jun-23 | 10-Jul-23 | 10-Jul-23 | 1 |
284 | Vacancy 284 | 13-Jul-23 | 19-Jun-23 | 17-Jul-23 | 17-Jul-23 | 1 | |
43 | Vacancy 43 | 05-Jul-23 | 14-Jul-23 | 06-Jul-23 | 14-Jul-23 | 14-Jul-23 | 1 |
301 | Vacancy 301 | 17-Jul-23 | 20-Apr-23 | 31-Jul-23 | 31-Jul-23 | 99 | |
31 | Vacancy 31 | 15-Jun-23 | 26-Jul-23 | 19-Jun-23 | 31-Jul-23 | 31-Jul-23 | 99 |
304 | Vacancy 304 | 13-Apr-23 | 27-Jul-23 | 20-Apr-23 | 22-May-23 | 22-May-23 | 1 |
277 | Vacancy 277 | 17-Mar-23 | 07-Aug-23 | 23-Mar-23 | 24-Apr-23 | 24-Apr-23 | 1 |
40 | Vacancy 40 | 28-Jun-23 | 08-Aug-23 | 29-Jun-23 | 17-Jul-23 | 17-Jul-23 | 1 |
65 | Vacancy 65 | 31-Jul-23 | 22-Aug-23 | 04-Aug-23 | 28-Aug-23 | 28-Aug-23 | 1 |
12 | Vacancy 12 | 23-May-23 | 29-Aug-23 | 02-Jun-23 | 23-Jun-23 | 23-Jun-23 | 1 |
76 | Vacancy 76 | 07-Aug-23 | 31-Aug-23 | 08-Aug-23 | 28-Aug-23 | 28-Aug-23 | 1 |
326 | Vacancy 326 | 1 | |||||
327 | Vacancy 327 | 1 | |||||
328 | Vacancy 328 | 1 | |||||
329 | Vacancy 329 | 1 |
Thank you
Solved! Go to Solution.
If you have blank Completed_Date values then you should not use an active connection between these two tables. Or you can see if "Show items with no data" is of any help.
If you have blank Completed_Date values then you should not use an active connection between these two tables. Or you can see if "Show items with no data" is of any help.
Thank you. Blanks are important in this scenario, that means vacancy is still open. Even though I inserted dates and there was no blanks, still it didn't work. But you were right about inactive relationship. Due to complex filtering and measure, it gave me correct results only with inactive relationship.
User | Count |
---|---|
103 | |
87 | |
77 | |
70 | |
69 |
User | Count |
---|---|
113 | |
99 | |
97 | |
72 | |
68 |