Join 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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Below is my Dax formula:
Medical Score =
Solved! Go to Solution.
Hi @Michael_DOC - you can modify the logic to filter out blank values in the FIRSTNONBLANK part of your measure.
ceck the below measure:
Medical Score =
VAR ClosestRow =
CALCULATE (
FIRSTNONBLANK(
SCORES[SCOR_MEDICAL],
NOT (ISBLANK(SCORES[SCOR_MEDICAL])) // Exclude blank values
),
FILTER (
SCORES,
SCORES[SCOR_PER_ID] = PS[Number] &&
ABS(DATEDIFF(PS[OffenseDt], SCORES[SCOR_EFF_DATE], DAY)) =
MINX (
FILTER (
SCORES,
SCORES[SCOR_PER_ID] = PS[Number] &&
NOT (ISBLANK(SCORES[SCOR_MEDICAL])) // Exclude blank values in comparison
),
ABS(DATEDIFF(PS[OffenseDt], SCORES[SCOR_EFF_DATE], DAY))
)
)
)
RETURN
ClosestRow
Hope it works
Proud to be a Super User! | |
Hi @Michael_DOC - you can modify the logic to filter out blank values in the FIRSTNONBLANK part of your measure.
ceck the below measure:
Medical Score =
VAR ClosestRow =
CALCULATE (
FIRSTNONBLANK(
SCORES[SCOR_MEDICAL],
NOT (ISBLANK(SCORES[SCOR_MEDICAL])) // Exclude blank values
),
FILTER (
SCORES,
SCORES[SCOR_PER_ID] = PS[Number] &&
ABS(DATEDIFF(PS[OffenseDt], SCORES[SCOR_EFF_DATE], DAY)) =
MINX (
FILTER (
SCORES,
SCORES[SCOR_PER_ID] = PS[Number] &&
NOT (ISBLANK(SCORES[SCOR_MEDICAL])) // Exclude blank values in comparison
),
ABS(DATEDIFF(PS[OffenseDt], SCORES[SCOR_EFF_DATE], DAY))
)
)
)
RETURN
ClosestRow
Hope it works
Proud to be a Super User! | |
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.