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.
Hello PowerBI users
I'm wanting to use an OR function... ,not sure how to do it... here's the measure:
Solved! Go to Solution.
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 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" } )
)
@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" } )
)
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]
)
)
)
Hi Daxer! Thanks so much for this, it worked perfectly!
@rayinOz , try like
TotalBooked = CALCULATE(COUNT('Session Report'[Session Attendance]), FILTER('Session Report', 'Session Report'[Session Attendance] in {"Booked" ,"Attended" }))
@rayinOz - Either will work:
TotalBooked = CALCULATE(COUNT('Session Report'[Session Attendance]), FILTER('Session Report', 'Session Report'[Session Attendance]="Booked" || 'Session Report'[Session Attendance]="Attended"))
TotalBooked = CALCULATE(COUNT('Session Report'[Session Attendance]), FILTER('Session Report', OR('Session Report'[Session Attendance]="Booked",'Session Report'[Session Attendance]="Attended")))
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 |
---|---|
70 | |
35 | |
21 | |
18 | |
15 |
User | Count |
---|---|
128 | |
29 | |
28 | |
24 | |
22 |