Forum Discussion
mihaita_baro
Helper II
4 years agoFirst occurence based on two filters
Hi there I have a table where i store multiple appoiments for the same clients. I need to calculate something called KPI4, which means the first appoiment where AppType is 2,3 or 5 and Atten...
- 4 years ago
- 4 years ago
Hello mihaita_baro
You can create a column like this:
KPI_5 = VAR a = IF ( COUNTX ( FILTER ( ALL ( 'Table' ), [ID] = EARLIER ( 'Table'[ID] ) ), [ID] ) >= 2, 1 ) RETURN IF ( a = 1 && [APPTYPE] IN { 2, 3, 5 } && [ATTENDANCE] IN { 5, 6, BLANK () }, 1 )Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.Best Regards,
Community Support Team _ Janey
mihaita_baro
Helper II
4 years agoTHanks, now it worked.
I have another KPI5 to calculate which means Clients must have at least 2 appoiments where AppType is 2,3 or 5 and Attendance is 5 or 6. or blank.
Not sure how i can count the appoiments based on multiple filters
v-janeyg-msft
Community Support
4 years agoHello mihaita_baro
You can create a column like this:
KPI_5 =
VAR a =
IF (
COUNTX ( FILTER ( ALL ( 'Table' ), [ID] = EARLIER ( 'Table'[ID] ) ), [ID] ) >= 2,
1
)
RETURN
IF (
a = 1
&& [APPTYPE]
IN { 2, 3, 5 }
&& [ATTENDANCE] IN { 5, 6, BLANK () },
1
)
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.
Best Regards,
Community Support Team _ Janey