Forum Discussion

elflakoconk's avatar
elflakoconk
Icon for Helper II rankHelper II
4 years ago
Solved

Filter visuals without direct relation (from many to 1 to many)

Hello everyone.   I've splited a single table and now I have a model with 4 tables. All have the same rows, the difference is that I'm splitting by topic.   Now I'm using 1 as a dimession table c...
  • MFelix's avatar
    4 years ago

    Hi elflakoconk ,

     

    Your issue is that you are making the Crossfilter relationship on the incorrect path, when you are summing the analfabetism you need that measure to be crossfiltered by the other tables so that should be the ones you use on your crossfilter in this case salud and discapacidad.

     

    Moreover since you are using direct columns on your other visualizations they will not get filter since you are not making the cross filter to be applied.

     

    Create the following 3 measures:

    Analfabetismo = 
    CALCULATE(
        SUM('Analfabetismo'[Valor]),
       CROSSFILTER(
            'Data'[Bloque],
            'Discapacidad'[Bloque],
            Both
        ),
        CROSSFILTER(
            'Data'[Bloque],
            'Salud'[Bloque],
            Both
        )
    )
    
    discapacidade = 
    CALCULATE(
        SUM('Discapacidad'[Valor]),
       CROSSFILTER(
            'Data'[Bloque],
            'Analfabetismo'[Bloque],
            Both
        ),
        CROSSFILTER(
            'Data'[Bloque],
            'Salud'[Bloque],
            Both
        )
    )
    
    Salud = 
    CALCULATE(
        SUM('Salud'[Valor]),
       CROSSFILTER(
            'Data'[Bloque],
            'Analfabetismo'[Bloque],
            Both
        ),
        CROSSFILTER(
            'Data'[Bloque],
            'Discapacidad'[Bloque],
            Both
        )
    )

     

    Has you can see each of the metrics is being crossfiltered by the other two table that way you can make it work, now use this metrics on the charts result below and in attach PBIX file.