Filter Function filters data from one input data source depending on a filter condition.
The sample below filters the Hist table for each employee in the Emp table after the current employee ID and lists the department he worked in.

Note: This sample can be found in FilterSample.dax from Samples\Job Samples folder.
OUTPUT:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns:root xmlns:ns="http://www.tempuri.org/XML">
<ns:emp id="1">
<ns:departments department="Accounting"/>
<ns:departments department="Sales"/>
<ns:departments department="Development"/>
<ns:departments department="Accounting"/>
</ns:emp>
<ns:emp id="2">
<ns:departments department="Accounting"/>
<ns:departments department="Sales"/>
<ns:departments department="Development"/>
</ns:emp>
<ns:emp id="3"/>
</ns:root>