Forum Discussion
rayinOz
6 years agoHelper III
COUNT and OR statement?
Hello PowerBI users I'm wanting to use an OR function... ,not sure how to do it... here's the measure: TotalBooked = CALCULATE(COUNT('Session Report'[Session Attendance]), FILTER('Session Re...
- Anonymous6 years ago
Hi there. Your formula does not adhere to Best Practices and hence may not be as fast as possible. Here's an optimized version:
TotalBooked = CALCULATE( COUNT('Session Report'[Session Attendance]), KEEPFILTERS( TREATAS( {"Booked", "Attended"}, 'Session Report'[Session Attendance] ) ) ) - 6 years ago
rayinOz You can use this:
TotalBooked = CALCULATE ( COUNT ( 'Session Report'[Session Attendance] ), KEEPFILTERS ( 'Session Report'[Session Attendance] = "Booked" || 'Session Report'[Session Attendance] = "Attended" ) )Or
TotalBooked = CALCULATE ( COUNT ( 'Session Report'[Session Attendance] ), KEEPFILTERS ( 'Session Report'[Session Attendance] IN { "Booked", "Attended" } ) )
Anonymous
6 years agoNot applicable
Hi there. Your formula does not adhere to Best Practices and hence may not be as fast as possible. Here's an optimized version:
TotalBooked =
CALCULATE(
COUNT('Session Report'[Session Attendance]),
KEEPFILTERS(
TREATAS(
{"Booked", "Attended"},
'Session Report'[Session Attendance]
)
)
)
rayinOz
6 years agoHelper III
Hi Daxer! Thanks so much for this, it worked perfectly!