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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Use Column 1 values to filter Column 2 and return column 1 values for same table

 

Hi good people,
In the below example i want to see the stores affected by a particular store . The table is imagined as below.

S.noStore AffectedAffected by 
1S01 
2S02S01
3S03 
4S04S03
5S05S02
6S06S02


So if the user selects S02 in "Stores Affected" Column the new table visualization need to display 

Stores Affected
S05
S06

 


Im very new to coding. Please help me get this in DAX. Thank you so much 

P.S: I have to use the "stores affected" column as my slicer I cannot use "Affected by" column as slicer

11 REPLIES 11
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

How about this?

v-lionel-msft_0-1597644763179.png

You need to create another table.

v-lionel-msft_1-1597644804910.png

 

Please refer to my .pbix file.

 

Best regards,
Lionel Chen

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

Anonymous
Not applicable

Hi @v-lionel-msft ,
Thank you for the reply. I can use selectedvalue(Sheet1'Stores Affected') instead of creating a new table right ? i tried both ways it doesnt work for my problem unfortuantely

Hi @Anonymous ,

 

v-lionel-msft_0-1598001986942.png

It is impossible to filter one value in the [Store Affected] column and return other values in the same column.

 

Best regards,
Lionel Chen

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

fhill
Resident Rockstar
Resident Rockstar

 

Is this what you are doing / seeing?  I have 'Affected By' column in my slicer.

 

 

fhill_0-1597435444126.png

 

fhill_1-1597435455909.png

 




Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
Thank You!




Anonymous
Not applicable

Yes the result is correct but I cannot use the "affected by" column as my slicer. I need to use "Stores Affected" Column as my slicer.

Thank you

Anand24
Super User
Super User

Hi @Anonymous ,

 

You don't need DAX for this.

Take a table visualization with "Store affected" field in it.

Now take a slicer visualization with"Affected By" field in it and choose any store in the slicer visualization to filter the above table with affected stores.

 

Give a thumbs up if this post helped you in any way and mark this post as solution if it solved your query !!!

Anonymous
Not applicable

hi @Anand24 ,
Thanks for replying . I cannot use the "affected by" Column as my slicer, ( this is small part of a bigger picture im trying to solve so its has to be stores affected column as my slicer) Do i need to create a separate table and then link it with one to one connection ?  

Hi @Anonymous ,

You can't take same field(Stores affected) in slicer and table visualizations in this case.

fhill
Resident Rockstar
Resident Rockstar

@Anonymous 

 

I wonder if we are missing a key part here.  Do you want the 'Affected by' Column to go away, or how is this different that just a Slicer selection of the 'Affected By' data?

 

FOrrest




Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
Thank You!




Anonymous
Not applicable

you just need to create a slicer, then drag Stores Affected into it. 

Karlos_0-1597434261978.png

 

 

Anonymous
Not applicable

Hi @Anonymous ,
If i do that it is just going to return filter with S02 

Store AffectedAffected by
S02S01


My requirement is it should take S02 from Store affected Column and store in Var say 'amp' and filter with 'amp' in column "Affected By" which will return 

Store AffectedAffected by
S05S02
S06S02



And those 2 stores S05 and S06 are the ones that should be displayed 

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.