Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hey all,
Was wondering if anyone could help me out. I have written a DAX Formula which shows me if there is a followup booked which is calculated as follows,
IF (
NOT ( ISBLANK ( [AppointmentCount] ) ),
VAR MaxDate =
MAX (Appointment[AppointmentDate] )
RETURN
CALCULATE (
MIN (Appointment[AppointmentDate] ),
ALL (Appointment),
SUMMARIZE (Appointment, Appointment[Patient ID] ),
Appointment[Date] > MaxDate,
Appointment[IsBooked]=TRUE()
)
)
In addition to this, I have another measure which returns to me, the name of the provider with whom the follow up is booked with
IF (
NOT ( ISBLANK ( [AppointmentCount] ) ),
VAR MaxDate =
MAX ( Appointment[AppointmentDate] )
RETURN
CALCULATE (
FIRSTNONBLANK(Appointment[Psychologist],1),
ALL ( Appointment ),
SUMMARIZE ( Appointment, Appointment[Patient ID] ),
Appointment[AppointmentDate] > MaxDate,
Appointment[IsBooked]=TRUE()
)
)
The issue is that the first measure works exactly as it should. However, the second measure sometimes give inconsistent results. Any idea about how this can be addressed?
Since the first measure works perfectly, Is there a way for me to use teh first measure and then return the respective value for a given column like Psychologist from there?
Hi, @Imrans123
Since your first formula has calculated the corresponding Appointment[Date], then you can use it to replace your ‘MaxDate’ in the second formula as a filter condition .
Please modify your second formula as below:
Your Second Measure=
IF (
NOT ( ISBLANK ( [AppointmentCount] ) ),
VAR MaxDate =
[Your first measure name]
RETURN
CALCULATE (
FIRSTNONBLANK(Appointment[Psychologist],1),
ALL ( Appointment ),
SUMMARIZE ( Appointment, Appointment[Patient ID] ),
Appointment[AppointmentDate] = MaxDate,
Appointment[IsBooked]=TRUE()
)
)
Best Regards,
Community Support Team _ Eason
Hi,
Share some data and show the expected result.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
User | Count |
---|---|
90 | |
89 | |
79 | |
69 | |
68 |
User | Count |
---|---|
222 | |
128 | |
117 | |
82 | |
77 |