Forum Discussion

rlmeyer's avatar
rlmeyer
Resolver I
5 years ago
Solved

Matrix Column Name Based on Slicer Selection

Hello,   I have a matrix that shows the project's name in the column section.  I would like to be able to switch between the real name and a hidden name from a slicer. I have two columns in my tabl...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi rlmeyer 

    I think you want to build a dynamic column header in Matrix visual. However we can't add a measure in column, you may transform your data model as below and build a measure to achieve your goal.

    Due to I don't know your data model, I build a sample.

    Fact Table:

    Then build a Hidden Table and Append two tables as a new one in Power Query Editor.

    New Table:

    Build a Slicer table and build a Measure.

     

    Measure =
    VAR _select =
        SELECTEDVALUE ( Slicer[Name] )
    RETURN
        IF (
            _select = "Estimate Name",
            CALCULATE (
                MAX ( Append1[Value] ),
                FILTER ( Append1, Append1[Column] <> "Hidden Name" )
            ),
            CALCULATE (
                MAX ( Append1[Value] ),
                FILTER ( Append1, Append1[Column] <> "Estimate Name" )
            )
        )

     

    Result is as below.
    Default:
     
    Select Estimate Name:
    You can download the pbix file from this link: Matrix Column Name Based on Slicer Selection
     
     

    Best Regards,

    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.