Forum Discussion
Michele_I
6 years agoFrequent Visitor
find related rows in a table
Hi all, i have a table like this (hundreds of records) named projects-tags: Project TAG project 1 tag A project 1 tag B project 1 tag C project 2 tag A project 2 tag D pr...
- 6 years ago
Hi,
I am sorry not to share my test pbix file with you.
After viewing your file, i find the problem is that it is due to the relationship between two tables.
You can remove this relationship, or if you do not want to remove it, please take following steps:
1)Create a new slicer table:
SlicerTable = DISTINCT(SELECTCOLUMNS('Projects-tags',"Label tag",'Projects-tags'[Label tag]))2)Change the original measure to this:
Control = IF ( SELECTEDVALUE ( 'Projects-tags'[Label tag] ) IN SELECTCOLUMNS ( FILTER ( ALLSELECTED ( 'projects-tags' ), [Project] IN SELECTCOLUMNS ( FILTER ( ALLSELECTED ( 'projects-tags' ), 'projects-tags'[Label tag] IN FILTERS ( 'SlicerTable'[Label tag] ) ), "P", [Project] ) ), "T", [Label tag] ) && NOT ( SELECTEDVALUE ( 'Projects-tags'[Label tag] ) IN FILTERS ( 'SlicerTable'[Label tag] ) ), 1, -1 )When you choose slicer, it shows:
Here is your pbix file changed by me:
Best Regards,
Giotto Zhi
amitchandak
Super User
6 years agoTry. Not tested
NewTable =
var selectedtag = maxx('Tags-table',SELECTEDVALUE('Tags-table'[Label tag])) //optional
return
CALCULATETABLE(all(projects-tags); 'projects-tags'[Label tag] <> selectedtag)Michele_I
6 years agoFrequent Visitor
amitchandak thank yu for your suggestion.
Unfortunately, i get the same output i was getting before with the code posted in my first message...
the TAG i choose in the slicer (in tags-table) is still there in the list of the calculated table, despite the filter (<> selectedtag).
any other idea?