Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi all,
I am trying to create a measure that shows the number of Job requests based on 2 Date columns.
I'd like to have as result for Oct/18 76 Job request.
I have created a relation between a CALENDAR tab and REC 1 (using the request date as a key point on REC 1) and the following measures:
DATE DATE:
Data Date = LASTDATE ( ALL ( 'Rec 1'[Request Date]) )
ON THE JOB:
ON THE JOB = IF (
[Data Date] >= MIN ( 'Calendar'[Date] ),
CALCULATE (
DISTINCTCOUNT ( 'Rec 1'[Reference number] ),
FILTER (
'Rec1',
COUNTROWS (
FILTER (
RELATEDTABLE ( Rec 1),
'Rec 1'[Request Date] <= MAX ( Calendar[Date] )
&& (
ISBLANK ( 'Rec 1'[Complete Date])
|| 'Rec 1'[Complete Date] >= MAX ( Calendar[Date] )
)
)
)
> 0
)
)
)
The problem is that this measure is retuning a number shorter than the right one.
ON THE JOB calculation is based the month select on the slicer (Calendar tab), it should count all Job request that have :
1. Request date same as the slicer
2. Complete date as same as the Slicer
3. Complete date blank.
In the sample attached, it should return 76 requests for Oct/18, the job reference number is highlited in blue for the right return results.
Any help is much appreciate.
Thanks !
Solved! Go to Solution.
Hi @Anonymous
You may refer to below measure. Delete the relationship between the two tables.
ON THE JOB =
CALCULATE (
COUNT ( 'Rec 1'[Reference Number] ),
FILTER (
'Rec 1',
'Rec 1'[Request Date] <= ENDOFMONTH ( Calendar[Date] )
&& (
MONTH ( 'Rec 1'[Complete date] ) >= MONTH ( SELECTEDVALUE ( 'Calendar'[Date] ) )
|| 'Rec 1'[Complete date] = BLANK ()
)
)
)
Regards,
Cherie
Hi,
You may download my PBI file from here. I have maintained the relationship with the Date Table.
Hope this helps.
Hi,
Why should the answer be 76? It should be 70.
Hi Ashish,
Because to calculate for Oct/18, you should filter all requests that have Request Date that until Oct/18 (included) and Complete date as Oct, blank or beyond.
In the Sample:
1. Total of Job Request are 90.
2. Request date on Oct or before are 88;
3. Request date on Oct or before and Complete date as Oct, blank or beyond is 76.
For example for September/18:
1. Total of Job Request are 90.
2. Request date on Sep or before are 71;
3. Request date on Sep or before and Complete date as Sep, blank or beyond is 68.
Hi,
You may download my PBI file from here. I have maintained the relationship with the Date Table.
Hope this helps.
Hi @Anonymous
You may refer to below measure. Delete the relationship between the two tables.
ON THE JOB =
CALCULATE (
COUNT ( 'Rec 1'[Reference Number] ),
FILTER (
'Rec 1',
'Rec 1'[Request Date] <= ENDOFMONTH ( Calendar[Date] )
&& (
MONTH ( 'Rec 1'[Complete date] ) >= MONTH ( SELECTEDVALUE ( 'Calendar'[Date] ) )
|| 'Rec 1'[Complete date] = BLANK ()
)
)
)
Regards,
Cherie
Thanks you !
It works properly.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 78 | |
| 46 | |
| 37 | |
| 31 | |
| 26 |