Forum Discussion

ghaines's avatar
ghaines
Resolver I
3 years ago
Solved

Using same column in rows and columns of matrix visual: Detecting row vs column context

I have different bands of customers defined based on their average monthly sales.  I'd like to display a matrix of migration between the bands i.e. how many customers have moved from band x to band y:

Customer band now                     1              2              3              4             5                6

Customer band 3 months ago

1

2

3

4

5

6

 

The values in the columns and rows will of course be identical.  I'm pretty sure you just can't have the same table column on the row and column of the matrix visual.  My solution is to duplicate the values in another table, providing the structure for this table. 

 

However, my actual question is around detecting the filter context:  I have used SELECTEVALUE, ISINSCOPE, ISFILTERED previously.  Within DAX, is there a way to detect whether these filters originate from the row context, column context or from a filter applied to the visual.  Also, is there a way to detect whether the filter is at the visual, page or report level?  I imagine you could find some use cases for that kind of information.

  • ghaines No, DAX is pretty clueless about stuff like that. There is ISFILTERED and ISCROSSFILTERED but that's about it.

8 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    ghaines No, DAX is pretty clueless about stuff like that. There is ISFILTERED and ISCROSSFILTERED but that's about it.

  • tpaliwal's avatar
    tpaliwal
    Frequent Visitor

    Hi,

     

    I'm trying to create a similar matrix as I have produced through sample dataset.

    I have different Lifecycles and I'm trying to show the migration of customers through different lifecycle over time.

    My question is around how do I use same field in rows and columns. And also make it dynamic based on the selected time period.

    • ghaines's avatar
      ghaines
      Resolver I

      My matrix was made with two disconnected tables that were identical except for name, and were used for the row and column axes of the matrix.  I could then use the values in row and column to define the logic of the dax expression that created the return value.  I don't think it's possible to read two different table contexts from row and column contexts.

      • tpaliwal's avatar
        tpaliwal
        Frequent Visitor

        Hi Ghaines,

        Is it possible for you to share the PBIX file so that I can see the logic and use of DAX?

         

        Appreciate your help!