Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
dc7669
Resolver I
Resolver I

How to build a filter for a report based on multiple columns?

Company NameN GAE GAS GA W GA
ABCX  X
DEF XXX
GHIX X 

 

I have a table in the above format.  I want to create a Power BI showing the company name who worked in a particular part of GA. 

 

I want a drop down list that say 

N GA

E GA

S GA

W GA

 

And then by selecting N GA, Company ABC and GHI will be displayed.  

 

How can I do this? 

 

I can create a separate list for the N/E/S/W GA list, but I don't know how it can be linked back to the above table.  

 

I can combine the 4 columns like below and use the Overall column as the slicer.  But, all possible combinations of N/E/S/W GA will show up as an option.  That is not good.  

Company NameN GAE GAS GA W GA

Overall

ABCX  XN GA; W GA
DEF XXXE GA; S GA; W GA
GHIX X  N GA; S GA

 

Any ideas? 

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @dc7669 

 

The easiest way is to use unpivot in Query Editor. Additonally, you may also try the following steps. I created data to reproduce your scenario.

Table:

b1.png

NewTable:

b2.png

 

You may create measures as below.

 

NGA = 
var _companyname = SELECTEDVALUE('Table'[Company Name])
var _value = LOOKUPVALUE('Table'[N GA],'Table'[Company Name],_companyname)
return
IF(
    "N GA" in FILTERS(NewTable[OverAll])&&_value<>BLANK(),
    1
)
EGA = 
var _companyname = SELECTEDVALUE('Table'[Company Name])
var _value = LOOKUPVALUE('Table'[E GA],'Table'[Company Name],_companyname)
return
IF(
    "E GA" in FILTERS(NewTable[OverAll])&&_value<>BLANK(),
    1
)
SGA = 
var _companyname = SELECTEDVALUE('Table'[Company Name])
var _value = LOOKUPVALUE('Table'[S GA ],'Table'[Company Name],_companyname)
return
IF(
    "S GA" in FILTERS(NewTable[OverAll])&&_value<>BLANK(),
    1
)
WGA = 
var _companyname = SELECTEDVALUE('Table'[Company Name])
var _value = LOOKUPVALUE('Table'[W GA],'Table'[Company Name],_companyname)
return
IF(
    "W GA" in FILTERS(NewTable[OverAll])&&_value<>BLANK(),
    1
)

Isdisplay = 
IF(
    [NGA]=1 || [EGA]=1 || [SGA]=1 || [WGA]=1,
    1,0
)

 

 

Then you need to put the 'Isdisplay' measure in the visual level filter. Here are the results.

b3.png

 

b4.png

 

b5.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-alq-msft
Community Support
Community Support

Hi, @dc7669 

 

If you take the answer of someone, please mark it as the solution to help the other members who have same problems find it more quickly. If not, let me know and I'll try to help you further. Thanks.

 

Best Regards

Allan

v-alq-msft
Community Support
Community Support

Hi, @dc7669 

 

The easiest way is to use unpivot in Query Editor. Additonally, you may also try the following steps. I created data to reproduce your scenario.

Table:

b1.png

NewTable:

b2.png

 

You may create measures as below.

 

NGA = 
var _companyname = SELECTEDVALUE('Table'[Company Name])
var _value = LOOKUPVALUE('Table'[N GA],'Table'[Company Name],_companyname)
return
IF(
    "N GA" in FILTERS(NewTable[OverAll])&&_value<>BLANK(),
    1
)
EGA = 
var _companyname = SELECTEDVALUE('Table'[Company Name])
var _value = LOOKUPVALUE('Table'[E GA],'Table'[Company Name],_companyname)
return
IF(
    "E GA" in FILTERS(NewTable[OverAll])&&_value<>BLANK(),
    1
)
SGA = 
var _companyname = SELECTEDVALUE('Table'[Company Name])
var _value = LOOKUPVALUE('Table'[S GA ],'Table'[Company Name],_companyname)
return
IF(
    "S GA" in FILTERS(NewTable[OverAll])&&_value<>BLANK(),
    1
)
WGA = 
var _companyname = SELECTEDVALUE('Table'[Company Name])
var _value = LOOKUPVALUE('Table'[W GA],'Table'[Company Name],_companyname)
return
IF(
    "W GA" in FILTERS(NewTable[OverAll])&&_value<>BLANK(),
    1
)

Isdisplay = 
IF(
    [NGA]=1 || [EGA]=1 || [SGA]=1 || [WGA]=1,
    1,0
)

 

 

Then you need to put the 'Isdisplay' measure in the visual level filter. Here are the results.

b3.png

 

b4.png

 

b5.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

BA_Pete
Super User
Super User

Hi @dc7669

In Power Query you should be able to unpivot the region columns in your table so you have a Company column, an Attribute column which will hold all your regions, and a Value column which will have all your Xs in.
You can then slice on the Attribute (Region) column as normal.

Pete


Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors