Forum Discussion

JasonXieee's avatar
JasonXieee
Helper I
1 year ago
Solved

How to use fields parameter to create a measure slicer? (cannot work in matrix's Values part)

Dear PBI community friends,


I followed this guidance (https://www.youtube.com/watch?v=uGiot_76KX0) and created a measure slicer for my matrix visual.

 

I have only one simple raw data table. Some columns are dimensions (product code, supplier, manufacturer, etc.), and some are KPIs (spend, price...). I have created the parameter table with 10 measures I selected. It generated a slicer for me automatically as well. But when I put this parameter into the Values part of my Matrix visuals, there is no related measure showing up in the table.

 

I tried to put the parameter in the Row or Column, it worked well. The row and column changed based on my slicer selection.

 

May I know what the problem is? Here is the screenshot. If you need more information, please let me know and I will respond as quick as possible.

 

 

 

One more side question: there is another solution to build a measures slicer: https://radacad.com/change-the-column-or-measure-value-in-a-power-bi-visual-by-selection-of-the-slicer-parameter-table-pattern. It is using a new measure table and SWTICH() function. I guess this is a solution for 4 years ago when we did not have parameters? May I know is there any difference between these two solutions?

 

 

Thank you so much,

Jason

 

  • wini_R's avatar
    wini_R
    1 year ago

    >> So is it a limitation of the measure slicer that user can only refer to measures, not columns?

    You can use columns as field parameters too, but these need to be used as dimensions (in rows or columns of matrix). Values require some sort of aggregation which we apply through measures (i.e. sum, average, min, etc) and by using just column in values it is not clear what calculation should be applied

     

    >> How can I put a number column into the slicer?

    Create a measure based on that column

6 Replies

  • wini_R's avatar
    wini_R
    Solution Supplier

    Hey JasonXieee,

    I've just tested that scenario on my end and it works fine, I can select a measure in the slicer and it's instantly reflected in a matrix.
    Does adding one of the measures separately into values section work as expected? Is the interaction between visuals turned on?

    • JasonXieee's avatar
      JasonXieee
      Helper I

      Hello Wini,

       

      Thanks for answering this.

       

      Do you put it in the Values fields? From my side, it works when I put the parameter in the row and column area but fails when I put in the Values fields. Therefore, it should not be a problem in the interaction. When I put the measure directly into the Values part, it works as well.

       

      May I see your parameter formula? I am thinking when I put the measure directly into the matrix, I need to select First to show the value. I guess the parameter cannot achieve this.

       

       

       

      Thank you.

       

      • wini_R's avatar
        wini_R
        Solution Supplier

        Hey JasonXieee,
        Yes, I put it in the Values section. Here is my parameter table:

        Please make sure that measures (marked in green) are really measures and not the columns, i.e. my Avg1 measure is:

        Avg1 = AVERAGE(tbl[Sales])