Data Studio
4.5K members online now
4.5K members online now
Ask questions about Data Studio
Guide Me

Data Studio: Create an "OR" filter

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I want to create a chart with session metrics for 2 pages on my site. The filters work separately (e.g. page = /page1/  and page = /page2/). However, the data doesn't populate when both filters are applied to the report. How do I accomplish an "or" filter (e.g. page = /page1/ OR page = /page2/)?

1 Expert replyverified_user
Marked as Best Answer.
Accepted by topic author Michalene B
September 2016

Re: Data Studio: Create an "OR" filter

Follower ✭ ✭ ☆
# 2
Follower ✭ ✭ ☆
You can likely accomplish this using a filter with the "Regex" match type, which would allow you to us regular expression to create the "OR" function you're after.

In Data Studio, go to the chart you are working on and navigate to the create filter option. Select the radio button "include", set your Dimension field to Page. Match type should be Regex. Then, in the expression field you can use the | character (pipe) , which in Regex means "OR".

For example, if I wanted to have a chart that showed sessions for and the expression would be "/page1|page2$" (without the quotes). This will only show pages that END in either /page1 OR /page2. The pipe (|) means "OR" and the dollar sign means "ends with".

When I was first getting started with Regex I found the guide Paul Koks over at Online Metrics put together really helpful:

Hope that helps!

Re: Data Studio: Create an "OR" filter

Top Contributor
# 3
Top Contributor

Hi @Michalene B - to add a filter which would include either A or B in terms of Sessions where a pageA or PageB happened - use the setup as in example:


Please note that in your case place the character | between the pages you need inside the report. 


Hope it helps. 


Kind regards,




Web analyst @