Forum Discussion

jas_power's avatar
jas_power
Icon for Helper I rankHelper I
3 years ago
Solved

Determine Common Value Between Selected Items

Is there a way to write a measure to replicate the total column in a matrix? I need to find, of all the items selected from a slicer, what is common between them according to another variable in anot...
  • jas_power's avatar
    3 years ago

    I figured it out. I created a measure that I can use as a filter where geographyFilter = 1 on my geography slicer.

     

    geographyFilter = 
    var countofSelected = IF(ISFILTERED(prod_map[prodNameBase]), COUNTROWS(VALUES(prod_map[prodNameBase])),0)
    var countofGeography = CALCULATE(COUNT(addGeography[geoId]),ALLSELECTED('prod_map'[prodNameBase]))
    return
    IF(countofSelected = countofGeography, 1, 0)

     

    Where prod_name_base is the variable that feeds my Product slicer and geoId is the id that links to my geography dimension table. 

     

    Here is the result - I left the matrix in just to show that it's working:

    I hope this may help someone in the future.