Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Filter by Column heading in matrix visual

I have a matrix visual with 2 types of value. I would like to make a filter which allows the user to choose either one or both.    The matrix now looks as follow:   Year           |       2016   ...
  • MFelix's avatar
    8 years ago

    Hi Anonymous,

     

    Theres is a similar request on this post and if you go to the exceleratorbi link on that message you have the explanation on how to achieve a measure in rows, however you can adjust this to your model to achieve it in columns.

     

    I pick up your data and using the solution above work out this final result, see below the step by step and also a download for a pbix sample:

     

    1 - Create a new table:

    Measures Selection

    ID | Measure

    1   | EUR

    2  | L

    3 | Variation

     

    2 - Create a measure on the Measures Selection table:

    Selected_Measure = MAX('Measure_selection'[ID])

    3 - Create 4 measures on the Fact_Table (name given to the basic data table):

    EUR Total = SUM(Fact_Table[EUR])
    
    L Total = SUM(Fact_Table[L])

    Variation = [EUR Total] -  [L Total] Matrix_values = SWITCH ( [Selected_Measure]; 1 ; [EUR Total] ; 2 ; [L Total] ;
    3 ; [Variation] )

    4 - Add the values to your visual matrix as explained:

    Rows: Product (column Fact_Table)

    Columns: Purchase Date - Year (column Fact_Table) + Measure (column Measure_selection)

    Values: Matrix_values (measure from Fact_table

     

    5 - Add a slicer with the Measure Column on your report.

     

    Final result:

     

    Here is the pbix file.

     

    Regards,

    MFelix