Forum Discussion

Michele_I's avatar
Michele_I
Frequent Visitor
6 years ago
Solved

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...
  • v-gizhi-msft's avatar
    v-gizhi-msft
    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:

    pbix 

     

    Best Regards,

    Giotto Zhi