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
newpbiuser01
Helper IV
Helper IV

Dynamically change matrix visual value

Hello,

I have created a matrix visual using the Fields parameters to allow a user to dynamically change the rows and columns in the table. I would typically drive the value field for the matrix with a measure that uses a the slicer value of metric options - spend, volume etc. However, it looks like I can't use a measure in this case. Does anyone know if its possible to toggle between multiple columns where the metrics are sometimes using the Sum and sometimes DistinctCount functions. 

I'd really appreciate any help!

1 ACCEPTED SOLUTION
itchyeyeballs
Impactful Individual
Impactful Individual

If you are using the new field parameters you can use this to create a new measure that dynamically selects a measure or column

xP_param1 = 
SWITCH (
    SELECTEDVALUE ( xP_Param[xP_Param Order] ),
    0, [Measure1],
    1, [Measure2],
    2, [Measure3],
    3, [Measure4],
    4, [Measure5]
)

 you can then use this in the values section to give you the right calculation for the selection 

It uses the sort order column to link a measure to each parameter option.

View solution in original post

3 REPLIES 3
itchyeyeballs
Impactful Individual
Impactful Individual

If you are using the new field parameters you can use this to create a new measure that dynamically selects a measure or column

xP_param1 = 
SWITCH (
    SELECTEDVALUE ( xP_Param[xP_Param Order] ),
    0, [Measure1],
    1, [Measure2],
    2, [Measure3],
    3, [Measure4],
    4, [Measure5]
)

 you can then use this in the values section to give you the right calculation for the selection 

It uses the sort order column to link a measure to each parameter option.

amitchandak
Super User
Super User

@newpbiuser01 , Not very clear, But I have used field parameters in values of matrix too. I created a field parameter using measures and use that in values

Hi @amitchandak,

I was under the impression that the field parameters would not work with explicit summarization - which I think is using a measure. I may be misunderstanding how to use these field parameters. 😞

Thank you!

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.