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

How can I change the value in a matrix to change according to the filter selected

HI , In my model I have the following columns: *Country *Products *cost price *selling price following measures: *profit *profit% In my report I have a matrix with rows as Country and Products and values as Profit and Profit%. But I want to create a slicer where in my client can choose where he wants to have a look at Profit or Profit% and accordingly in the matrix only profit or profit% or both will be visible . (Kindly note: Profit and Profit % cannot be changed to columns as in the actual model they are measures which is used to display a number of other measures from a different table)
1 ACCEPTED SOLUTION
v-ljerr-msft
Employee
Employee

Hi @RashmitaR,

 

According to your description above, you should be able to follow steps below to get your expected result.Smiley Happy

 

1. Add a new table with a single column of measure type to your model like below.

Type
profit
profit%

2. Create a new measure to show "profit" and "profit%" according to measure type.

Measure =
SWITCH (
    FIRSTNONBLANK ( NewType[Type], 1 ),
    "profit", [profit],
    "profit%", [profit%],
    BLANK ()
)

3. Add a Matrix to report with Rows as Country and Products and Values as the new created measure, Columns as measure Type from the new created table.

r3.PNG

 

Regards

View solution in original post

1 REPLY 1
v-ljerr-msft
Employee
Employee

Hi @RashmitaR,

 

According to your description above, you should be able to follow steps below to get your expected result.Smiley Happy

 

1. Add a new table with a single column of measure type to your model like below.

Type
profit
profit%

2. Create a new measure to show "profit" and "profit%" according to measure type.

Measure =
SWITCH (
    FIRSTNONBLANK ( NewType[Type], 1 ),
    "profit", [profit],
    "profit%", [profit%],
    BLANK ()
)

3. Add a Matrix to report with Rows as Country and Products and Values as the new created measure, Columns as measure Type from the new created table.

r3.PNG

 

Regards

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.