Forum Discussion

gtek's avatar
gtek
Regular Visitor
8 years ago

Slicer does not filter rows in Matrix when I add a Measure (containing IF) to the Matrix Values

Hello All

 

I am stuck with a problem I cannot quite get my head around. I have a Matrix, and a Slicer which filters the matrix on the same page with no problem. The slicer hides rows on the Matrix as expected.

 

However, when I add a certain Measure to the Matrix values, the slicer does not work in the same way. For instance, if I select a certain group in the slicer, all of the rows on the Matrix remain, but the values are zeroed for the rows that are not in the selected group.

 

The measure in question has an 'IF' statement which tests the selection of a Parameter slicer to determine it's value. I'm not entirely confident about my treatment of the fields in this formula, particularly the use of 'VALUES'. Please note that 'VALUE' is used because I have not correctly set the type of the columns in question, and the final 'IF' statement is a placeholder, as I need to handle incorrect parameter selections when I have solved this problem.

 

IF(
	HASONEVALUE('Parameters 2'[ParameterValue]),
	IF(
		VALUES('Parameters 2'[ParameterValue]) = "Condition",
		VALUE(VALUES(Assets[probability_condition])),
		IF(
		        VALUES('Parameters 2'[ParameterValue]) = "Remaining Life",
			VALUE(VALUES(Assets[probability_remaining_life])),
			MAX(VALUE(VALUES(Assets[probability_condition])), 
VALUE(VALUES(Assets[probability_remaining_life]))) ) ), IF( NOT(ISFILTERED('Parameters 2'[ParameterDescription])), 0, 0 ) )

 

I am very new to Power BI/DAX but I have varying experience in other technologies so I am just looking for a nudge in the right direction!

 

Thanks very much

Greig

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    gtek,

    Could you please share sample data of your table that can be copied and pasted, and post expected result here? We also want to know what fields you use to create the Matrix visual and what output would you like to display when using slicer?

    Regards,
    Lydia