Forum Discussion
Measure or a Column question
- 4 years ago
Here is the calculation in DAX for the calculated column. It returns 1 if the user passed all the trainings. Let me know if it works.
Flag =
VAR WhichUser = 'Table'[User]
VAR NoOfPasses =
CALCULATE (
COUNT ( 'Table'[PASS/FAIL] ),
ALL ( 'Table' ),
'Table'[User] = WhichUser,
'Table'[PASS/FAIL] = "PASS"
)
VAR NoOfTrainings =
CALCULATE (
COUNT ( 'Table'[Training Name] ),
ALL ( 'Table' ),
'Table'[User] = WhichUser
)
RETURN
IF ( NoOfPasses = NoOfTrainings, 1, 0 )
- 4 years ago
This includes a clause where it will ignore any fails older than 1 year
Flag =
VAR WhichUser = 'Table'[User]
VAR CutOffDate = EDATE(TODAY(), -12)
VAR NoOfPasses =
CALCULATE(
COUNT('Table'[PASS/FAIL]),
ALL('Table'),
'Table'[User] = WhichUser,
'Table'[PASS/FAIL] = "PASS",
'Table'[Merge] >= CutOffDate
)
VAR NoOfTrainings =
CALCULATE(
COUNT('Table'[Training Name]),
ALL('Table'),
'Table'[User] = WhichUser,
'Table'[Merge] >= CutOffDate
)
RETURN
IF( NoOfPasses = NoOfTrainings, 1, 0)
Do you mind showing how I can get the calculated column for this? Just showing on a table view
Here is the calculation in DAX for the calculated column. It returns 1 if the user passed all the trainings. Let me know if it works.
Flag =
VAR WhichUser = 'Table'[User]
VAR NoOfPasses =
CALCULATE (
COUNT ( 'Table'[PASS/FAIL] ),
ALL ( 'Table' ),
'Table'[User] = WhichUser,
'Table'[PASS/FAIL] = "PASS"
)
VAR NoOfTrainings =
CALCULATE (
COUNT ( 'Table'[Training Name] ),
ALL ( 'Table' ),
'Table'[User] = WhichUser
)
RETURN
IF ( NoOfPasses = NoOfTrainings, 1, 0 )
- sraj4 years agoResponsive Resident
That worked, I had other exceptions on there due to which I didnt see it all....but it works beautifully!! Thank you!!
- sraj4 years agoResponsive Resident
Tutu_in_YYC - can I add this clause in too? Users falling in this category and have passed between these dates can be 1 too... those examples I shared had failed before 3/11/2021 date of failure was 12/15/2020
- sraj4 years agoResponsive Resident
USER Dept Training Name PASS/FAIL Merge A HR WEB PASS 3/1/2022 A HR SOCIAL PASS 11/17/2020 A HR PERSONAL PASS 12/1/2020 A HR PROACTIVE PASS 12/8/2020 B IT WEB FAIL 12/15/2020 B IT SOCIAL FAIL 11/17/2020 B IT PERSONAL PASS 11/9/2021 B IT PROACTIVE PASS 3/1/2022 B IT PASSPHRASE PASS 12/15/2020 B IT INSIDER PASS 12/22/2020 C RESP PROACTIVE PASS 9/7/2021 C RESP PASSPHRASE PASS 10/5/2021 C RESP INSIDER PASS 11/2/2021 D OT WEB FAIL 5/24/2021 D OT SOCIAL PASS 12/22/2020 D OT PERSONAL PASS 2/2/2021 D OT PROACTIVE PASS 3/2/2021 - Tutu_in_YYC4 years agoSuper User
This includes a clause where it will ignore any fails older than 1 year
Flag =
VAR WhichUser = 'Table'[User]
VAR CutOffDate = EDATE(TODAY(), -12)
VAR NoOfPasses =
CALCULATE(
COUNT('Table'[PASS/FAIL]),
ALL('Table'),
'Table'[User] = WhichUser,
'Table'[PASS/FAIL] = "PASS",
'Table'[Merge] >= CutOffDate
)
VAR NoOfTrainings =
CALCULATE(
COUNT('Table'[Training Name]),
ALL('Table'),
'Table'[User] = WhichUser,
'Table'[Merge] >= CutOffDate
)
RETURN
IF( NoOfPasses = NoOfTrainings, 1, 0)