cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Anonymous
Not applicable

Hi guys,

I am still figuring out how to use DAX. I have come up with the same answer using what looks like different DAX.

Is one better than the other or are they both essentially the same? I think the latter might be more efficent as it only filters a column. And what about OR and II, do these mean the same thing?

1.

=CALCULATE (
[TotalHours],
FILTER (
EmployeeHours,
EmployeeHours[Code] = "PICK"
|| EmployeeHours[Code] = "AXE"
)
)

2.

=CALCULATE (
[TotalHours],
FILTER (
ALL ( EmployeeHours[Code] ),
OR (
EmployeeHours[Code] = "PICK",
EmployeeHours[Code] = "AXE"
)
)
)

1 ACCEPTED SOLUTION
Super User

@Anonymous yes || and OR are doing the same thing here.  One is a Function and another one is an operator .

In this case, you can use in

CALCULATE (
[TotalHours],
FILTER (
EmployeeHours,
EmployeeHours[Code] in { "PICK" , "AXE" }
)
)

I try to avoid or as far as possible

2 REPLIES 2
Super User

@Anonymous yes || and OR are doing the same thing here.  One is a Function and another one is an operator .

In this case, you can use in

CALCULATE (
[TotalHours],
FILTER (
EmployeeHours,
EmployeeHours[Code] in { "PICK" , "AXE" }
)
)

I try to avoid or as far as possible

Anonymous
Not applicable

@amitchandak  Thanks for that...Although now there is a third way to do this calculation 😄

Announcements

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

#### Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

#### Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors