cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

filter a column with same value as selected value in slicer

Hello Power BI Community !

 

I am trying to do something that is supposed to be very simple but I can't manage to do it.

 

I have a slicer that call a column ('Facts'[Company]) with 5 values (AAPL, MSFT, FB, AMZN, GOOG)

When one of theses values is selected, I want another column ('Facts'[Company Flag], which has same values, to be filtered according to the filtered value.

 

I think It should be a Dax formula with SelectedValue and Switch/IF, but I am not sure how to do it. can you help me please ?

Maybe like :

MyCustomFilter = IF SelectedValue('Facts'[Company]) = "AAPL";

Filter('Facts'[Company Flag],"AAPL"

 

right ?

 

Best regards,

MYPE

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Advocate II
Advocate II

Re: filter a column with same value as selected value in slicer

Hi @v-juanli-msft

 

I found another way to do what I want.

What I needed was just a custom column with 2 conditions :

 

If [Date] = "01/01/1995" and [company] = "MSFT" then "Microsoft launches Windows 95".

 

The dashboard is now live on this public URL (data stories gallery) :

https://community.powerbi.com/t5/Data-Stories-Gallery/GAFAM-Market-Cap-Comparison-1980-2019-gt-The-r...

 

You may consider the case closed now.

Thanks

Best Regards,

 

MYPE (Make Your Process Easier) S.A.S

 

View solution in original post

7 REPLIES 7
Highlighted
Super User III
Super User III

Re: filter a column with same value as selected value in slicer

Hi @MYPE

I'm not sure I understand correctly but if 'Facts'[Company] and 'Facts'[Company Flag] are on the same table and have the same values, if you filter 'Facts'[Company] through a slicer you will be effectively filtering 'Facts'[Company Flag] as well, won't you?

Highlighted
Super User IX
Super User IX

Re: filter a column with same value as selected value in slicer

Can you share a sample of your data? If those two columns are in the same table and have the same values then when you filter one, it should essentially filter the other. But, one thing that you could do potentially would be something like this:

 

Measure = 
VAR __filter = MAX('Facts'[Company])
VAR __table = Filter('Facts', [Company Flag]=__filter)
RETURN
//do something here with your __table var

Not really certain what you are trying to accomplish.


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted
Advocate II
Advocate II

Re: filter a column with same value as selected value in slicer

@Greg_Deckler, Please find here the pbi file : https://1drv.ms/u/s!AkOv33tEaCSwoztpRFuXSotYJhDj What I am trying to do is : In "Key events" tab, there is a pulse chart .On this chart, I want o display only the pop ups that correspond to the company filtered on the "company slicer". For example, If the company "AAP"L is selected on the slicer, I want only the popup of AAPL to be displayed on the chart (they already have been flagged "AAPL" in the "Company Flag Column"). Is it clear now ? Best regards MYPE
Highlighted
Advocate II
Advocate II

Re: filter a column with same value as selected value in slicer

@Greg_Deckler, Please find access to the file right here : https://1drv.ms/u/s!AkOv33tEaCSwoztpRFuXSotYJhDj What I want to do : In the report, there is a tab called "Key Events". In this tab, there is a pulse chart with pop ups that display information from companies. Right now, all pop ups are displayed but I would like to display only pop up related to companies filtered on the slicer. Ex : I filter the company "AAPL" on the slicer, then I want only the pop ups related to "AAPL" to be displayed on the chart. To do this, I created a column called 'Company Flag' that flags the right company to be displayed, but I don't know how to do it. Possible to help me ? Many thanks in advance ! Best regards MYPE
Highlighted
Advocate II
Advocate II

Re: filter a column with same value as selected value in slicer

@AIB, Please find access to the file right here : https://1drv.ms/u/s!AkOv33tEaCSwoztpRFuXSotYJhDj Possible to help me ? Many thanks in advance ! Best regards MYPE
Highlighted
Community Support
Community Support

Re: filter a column with same value as selected value in slicer

Hi @MYPE

It is very strange :

when i add "company" column(in table1 or table2) to the slicer, it only show "APPL" avlue, other values don't exsit.

Could you clear me?

 

Best Regards

Maggie

Highlighted
Advocate II
Advocate II

Re: filter a column with same value as selected value in slicer

Hi @v-juanli-msft

 

I found another way to do what I want.

What I needed was just a custom column with 2 conditions :

 

If [Date] = "01/01/1995" and [company] = "MSFT" then "Microsoft launches Windows 95".

 

The dashboard is now live on this public URL (data stories gallery) :

https://community.powerbi.com/t5/Data-Stories-Gallery/GAFAM-Market-Cap-Comparison-1980-2019-gt-The-r...

 

You may consider the case closed now.

Thanks

Best Regards,

 

MYPE (Make Your Process Easier) S.A.S

 

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Upcoming Events

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors