PATHCONTAINS

Updated on

PATHCONTAINS is a DAX function that returns TRUE if a specified item exists within a given path string.

Syntax

PATHCONTAINS(
   Path,
   Item
)
Argument Properties Description
Path A string which contains a delimited list of IDs.
Item A value to be found in the path.

Return Values

A value of TRUE if item exists in path; otherwise FALSE.

Remarks

  • If item is an integer number it is converted to text and then the function is evaluated. If conversion fails then the function returns an error.

  • This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.

Example

The following example creates a calculated column that takes a manager ID and checks a set of employees. If the manager ID is among the list of managers returned by the PATH function, the PATHCONTAINS function returns true; otherwise it returns false.

= PATHCONTAINS(PATH(Employee[EmployeeKey], Employee[ParentEmployeeKey]), "23")

Other functions related to PATHCONTAINS are:

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/dax/pathcontains-function-dax

2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy