The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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! | |