Forum Discussion
Checking for multiple Ids
- 1 year ago
Thanks to gmsamborn for suggestion the below solution - I only needed to change under VAR _NotCommenced the Application Dimension[Status] to IN {Offer, Background Checks, Onboarding}
IsJobArchivable = VAR _Job = [JobID] VAR _Commenced = COUNTROWS( FILTER( 'FactTable', 'FactTable'[JobID] = _Job && RELATED( 'Application Dimension'[Status] ) = "Commenced" ) ) VAR _NOTCommenced = COUNTROWS( FILTER( 'FactTable', 'FactTable'[JobID] = _Job && RELATED( 'Application Dimension'[Status] ) <> "Commenced" ) ) VAR _Result = IF( _Commenced > 0 && _NOTCommenced = 0, TRUE(), FALSE() ) RETURN _Result
hi Silvard ,
You can write the calculation as follows:
JobStatus =
VAR CurrentJobID = FactTable[JobID]
VAR CandidatesCommenced =
CALCULATE(
COUNTROWS(FactTable),
FactTable[JobID] = CurrentJobID,
RELATED(DimApplication[Status]) = "Commenced"
)
VAR CandidatesInOfferOrOnboarding =
CALCULATE(
COUNTROWS(FactTable),
FactTable[JobID] = CurrentJobID,
RELATED(DimApplication[Status]) IN {"Offer", "Onboarding"}
)
RETURN
IF(
CandidatesCommenced > 0 && CandidatesInOfferOrOnboarding = 0,
"Completed",
"Not Completed"
)
make sure to update the status based on your's.
If this post helps, then I would appreciate a thumbs up 👍 and mark it as the solution to help the other members find it more quickly.
- Silvard1 year agoResolver I
Hi Selva,
Thanks your prompt response.
I have tried the above but am getting the below error:
True/False expression does not specify a column. Each True/False expressions used as a table filter expression must refer to exactly one column.
How can we rewrite the formula please?
- Silvard1 year agoResolver I
I updated the formula using relatedtable instead, but It's still not producing the expected result.
In fact another formula, much simpler, produces the same result.
ApplicationisCompleted =
IF(DimApplication[Status])<>"", Completed)This column contains the candidates who have finalised their onboarding and otherwise "".
I somehow need a formula that checks this column and where there are "Completes", check the JobID for any other ApplicationID's that are going through the offer and onboarding stages.
This column is what equals the below in your formula.
RELATED(DimApplication[Status]) = "Commenced"
- powerbiexpert221 year agoImpactful Individual
Hi Silvard ,
please try below ,please see below pbix file for reference
https://drive.google.com/file/d/1bTAgptmF5RFZQ4jwQdg3CrY77rWcTFTS/view?usp=drive_link
completed jobs =CALCULATE(COUNTROWS(RELATEDTABLE(application_dim)),application_dim[completed]="Y" && application_dim[stage]<>"Offer")