Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Filter a matrix visual by measure so it only shows that column

In this matrix, the columns "5cm" and "14cm" are measures.  I would like a mobile user (who I will share the report with) to be able to choose which measure they see, so if they choose "5cm"  the visual then only shows that column and hides the "14cm" column.  I know you can't use measures in a slicer so I'm not sure how else I can achieve this.

 

Screen Shot 2019-04-30 at 3.06.20 PM.jpg

 

So basically, what I'd like them to be able to see is this:

 

Screen Shot 2019-04-30 at 3.15.39 PM.jpg

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

A typical way of handling this is with a "measure selector" measure.

  1. Create a disconnected table containing one column, which is used to select which measure to display. In your case the table would contain two rows with values "14cm" and "5cm". For example, the table could be called 'Measure Selector' with column Measure.
  2. Create a measure like this, assuming you already have measures [5cm] and [14cm]:
    Selected Measure = 
    SWITCH (
        SELECTEDVALUE ( 'Measure Selector'[Measure] ),
        "5cm",[5cm],
        "14cm",[14cm]
    )
  3. Add a slicer with field 'Measure Selector'[Measure]
  4. Then use Selected Measure as the matrix values field.

Here's a very small example pbix.

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

3 REPLIES 3
OwenAuger
Super User
Super User

A typical way of handling this is with a "measure selector" measure.

  1. Create a disconnected table containing one column, which is used to select which measure to display. In your case the table would contain two rows with values "14cm" and "5cm". For example, the table could be called 'Measure Selector' with column Measure.
  2. Create a measure like this, assuming you already have measures [5cm] and [14cm]:
    Selected Measure = 
    SWITCH (
        SELECTEDVALUE ( 'Measure Selector'[Measure] ),
        "5cm",[5cm],
        "14cm",[14cm]
    )
  3. Add a slicer with field 'Measure Selector'[Measure]
  4. Then use Selected Measure as the matrix values field.

Here's a very small example pbix.

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

Hi Owen,

 

I found your comment and did some emendments  and works.

 

However my issue is that when I slect a brand from a slicer all data is showing, I would like to see only the data for the slected slicer.

 

Any idea how to go around?

 

Thanks,

 

Stephen

Anonymous
Not applicable

That worked and so simple, thanks for the example that was really helpful to use.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.