Forum Discussion
mihaita_baro
4 years agoHelper II
First 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
CNENFRNL
4 years agoCommunity Champion
- mihaita_baro4 years agoHelper II
Hi,
I am getting the folowing error message.
- v-janeyg-msft4 years agoCommunity Support
Hi, mihaita_baro
You wrote return part in the maxx function, which caused an error.
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_baro4 years agoHelper II
THanks, 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