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.
Hi all,
I have created a group of measures to take the count of patients whose last status were active:
Solved! Go to Solution.
Hi @yashwant101 ,
Your current Last Status measure returns the last status based on the very last txn_dt in the entire dataset (and even uses a MAX on the status on that date). That’s not per-patient and not anchored to the end of the month in your visuals.
When a patient has no activity in a given month, their “last status” for that month should be the status at their last transaction date up to the end of that month. Your current logic doesn’t do that, so they aren’t counted in months with no activity._
What you need
A calculation that, for the current month (or end date of the current period), finds for each patient:
their last transaction date <= end-of-month
the status on that exact date
Then count patients whose that status is ACTIVE.
A robust pattern (as of period end) Replace or augment your logic with a measure that computes per patient the last transaction date up to the period end, then checks the status on that date.
Active patients as of period end (per month)
This measure counts distinct patients whose last status up to the end of the current period is ACTIVE.
Active Patients (as of period end) = VAR EndDate = MAX(rpt_ecd_perf[txn_dt]) RETURN CALCULATE( DISTINCTCOUNT(rpt_ecd_perf[ptnt_id]), FILTER( VALUES(rpt_ecd_perf[ptnt_id]), VAR LastDate = CALCULATE( MAX(rpt_ecd_perf[txn_dt]), FILTER( rpt_ecd_perf, rpt_ecd_perf[ptnt_id] = EARLIER(rpt_ecd_perf[ptnt_id]) && rpt_ecd_perf[txn_dt] <= EndDate_
Please mark this post as solution if it helps you. Appreciate Kudos.
Hi @yashwant101 ,
I would also take a moment to thank @FarhanJeelani , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions
Hi @yashwant101 ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.
Thank you.
Hi @yashwant101 ,
I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you
Your current measure only counts patients with transactions in the current month. To fix that, you need to evaluate each patient’s last known status up to the selected month, even if they have no record that month.
✅ Fix:
Use a disconnected date table and rewrite your logic to find each patient’s latest status before or on the selected date. Then count those with "ACTIVE" status.
This way, your monthly graph will include patients who were still active but didn’t have a transaction that month.
Hi @yashwant101 ,
Your current Last Status measure returns the last status based on the very last txn_dt in the entire dataset (and even uses a MAX on the status on that date). That’s not per-patient and not anchored to the end of the month in your visuals.
When a patient has no activity in a given month, their “last status” for that month should be the status at their last transaction date up to the end of that month. Your current logic doesn’t do that, so they aren’t counted in months with no activity._
What you need
A calculation that, for the current month (or end date of the current period), finds for each patient:
their last transaction date <= end-of-month
the status on that exact date
Then count patients whose that status is ACTIVE.
A robust pattern (as of period end) Replace or augment your logic with a measure that computes per patient the last transaction date up to the period end, then checks the status on that date.
Active patients as of period end (per month)
This measure counts distinct patients whose last status up to the end of the current period is ACTIVE.
Active Patients (as of period end) = VAR EndDate = MAX(rpt_ecd_perf[txn_dt]) RETURN CALCULATE( DISTINCTCOUNT(rpt_ecd_perf[ptnt_id]), FILTER( VALUES(rpt_ecd_perf[ptnt_id]), VAR LastDate = CALCULATE( MAX(rpt_ecd_perf[txn_dt]), FILTER( rpt_ecd_perf, rpt_ecd_perf[ptnt_id] = EARLIER(rpt_ecd_perf[ptnt_id]) && rpt_ecd_perf[txn_dt] <= EndDate_
Please mark this post as solution if it helps you. Appreciate Kudos.
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.