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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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
Anonymous
Not applicable

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
Greg_Deckler
Super User
Super User

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!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@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
Anonymous
Not applicable

@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
AlB
Super User
Super User

Hi @Anonymous

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?

Anonymous
Not applicable

@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

Hi @Anonymous

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

Anonymous
Not applicable

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

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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