[go: up one dir, main page]

0% found this document useful (0 votes)
274 views11 pages

FILTER Function in Power BI

The FILTER function in DAX is used to filter a table based on certain conditions. It accepts two arguments: 1) a table and 2) a logical condition. The function will return a new table containing only the rows from the original table that meet the condition. The document provides examples of using FILTER on both physical tables from the data model as well as virtual tables created on the fly. It demonstrates filtering a sales table to only include rows where the sales amount is greater than or equal to $20, and filtering dates to only include those where total sales were greater than or equal to $50,000.

Uploaded by

Tony Joseph
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
274 views11 pages

FILTER Function in Power BI

The FILTER function in DAX is used to filter a table based on certain conditions. It accepts two arguments: 1) a table and 2) a logical condition. The function will return a new table containing only the rows from the original table that meet the condition. The document provides examples of using FILTER on both physical tables from the data model as well as virtual tables created on the fly. It demonstrates filtering a sales table to only include rows where the sales amount is greater than or equal to $20, and filtering dates to only include those where total sales were greater than or equal to $50,000.

Uploaded by

Tony Joseph
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

FILTER..

()
Function
in Power BI
01
FILTER () Syntax
The FILTER function is used to filter a table based on
certain condition(s). Let’s explore the intricacies of the
DAX FILTER function.

The FILTER function accepts two arguments -


1. Table
2. Condition

= FILTER(
Table,
Condition
)

youtube.com/@GoodlyChandeep
02

1. The first argument, i.e. Table, accepts a physical or a


virtual table to Filter.

A physical table can be seen in the data model.


A virtual table is one that is created on the fly.

2. The second argument, i.e. Condition accepts a logical


test that is performed in each row of the table.

All rows that satisfy the condition, i.e. return TRUE


are kept while other rows are removed.
Keep in mind the condition must return a TRUE or
FALSE output else it stands invalid.

Remember - The output of the FILTER function is a


table containing the rows that satisfy the condition.

youtube.com/@GoodlyChandeep
03

FILTER Function in a Physical


Table
Let’s apply the FILTER function to the following data,
with the condition that the value in the Sales Amount
column should be $20 or more.

youtube.com/@GoodlyChandeep
04

As the FILTER Function returns a Table, let's create a


Table. Go to Table Tools >>> New Table.

Consider the following DAX code for the table, which


includes a condition that the Sales Amount column
should be greater than or equal to $20.

youtube.com/@GoodlyChandeep
05
In return you’ll get a table with rows that match the
condition.

The FILTER function gives a


table with rows where Sales
Amount >= $20.

youtube.com/@GoodlyChandeep
06
FILTER Function used on a
Virtual Table
The Sales table was a physical table present in the Data
Model, let’s see if we can apply the FILTER function to a
table that doesn’t physically exist i.e. a Virtual Table.

Let’s create a virtual table consisting of all dates where


Total Sales >= $50000. Consider this DAX for creating a
Table.

-- (1)
-- (2)

(1) The VALUES Function creates a one columnar table with


unique Dates.
(2) Then FILTER Functions Checks the condition if the Total
Sales Value for each date is >= $50,000.

youtube.com/@GoodlyChandeep
07

You’ll again get a table with rows that match the


condition.

The output has 133 rows, indicating 133


days of sales over $50,000.

youtube.com/@GoodlyChandeep
I’ve covered a lot more in this
video. You’ve got to watch it.

10:13

DAX FILTER Function


Goodly

youtube.com/@GoodlyChandeep
Jumpstart your learning

DAX & Data Modeling Course

A step by step guide to learn DAX and Data


Modeling to solve real time business problems in
Power BI.

Learn More
Hi, My name is
Chandeep

Checkout my courses on Power BI


Learn More

You might also like