user3186707
user3186707

Reputation: 101

How to filter data based on two conditions in rows in Tableau

I have a simple dataset from which I need to filter and show number of users in the form of bar graph, however since the data is structured in such a way and it is a live connection I cannot make changes to the data source.

What I need is, I need to display the numbers users who is part of 1) Worldwide Global access & 2) Worldwide Region access and when it comes to Worldwide Region access, the following columns i.e. Region and Sub region should be "ALL" and if any one of the columns are not ALL then the 2nd condition is not met. I tired adding a filter and when the 1st filter is added then by default 2nd filter will be False and I cannot use the 2nd filter and vice versa.

I have tried it and I couldn't find a solution to this problem.

The result should be only the following user "AAAA" meets the 2 conditions as user has "Worldwide Global access and Worldwide Region access and also Region and Sub Region is "ALL".

Can someone please let me know how to achieve the desired results.

enter image description here

Upvotes: 1

Views: 1607

Answers (1)

AnilGoyal
AnilGoyal

Reputation: 26238

Leave the dimension filter as it is, and use the following calculated field (will return boolean values) as your filter.

calculated field 1 say desired filter (set it to TRUE in filters card)

(If [Access level] = 'Worldwide Region access' then [Region] END) = 'ALL'
AND
(If [Access level] = 'Worldwide Region access' then [Sub Region] END) = 'ALL'
AND
{Fixed [User] : SUM(
If [Access level] = 'Worldwide Global access' then 1 else 0 END) } >0

It should work.

enter image description here

enter image description here

enter image description here

Or if you want these as two separate filters, use these by breaking the conditions in two say filter 2

(If [Access level] = 'Worldwide Region access' then [Region] END) = 'ALL'
AND
(If [Access level] = 'Worldwide Region access' then [Sub Region] END) = 'ALL'

AND first one say filter 1

{Fixed [User] : SUM(
If [Access level] = 'Worldwide Global access' then 1 else 0 END) } >0

enter image description here

Upvotes: 1

Related Questions