Forum Discussion

micha_a's avatar
micha_a
Frequent Visitor
3 years ago

Measure If statement and HasOneValue; enable button based on values

I have the following data: 1. Themathic area, once an area is selected, the user has to choose from the Questions table the items that they wish to see more detail for. Once the item is selected the button next to it (see more details ) is enabled and they can drill through another page to see more details about that specific question.

 

The questions are categorised under field Drillthrough in  Type 1 and Type 2 and Trend and each button takes you to that Type 1/2/Trend page.

 

If a question of Type 1 is selected, I want the button type 1 to be enabled, if a type 2 question is slected I want only Type 2 button to be enabled.

 

I created a measure for the button to display the value of the item selected, but both buttons are now enabled wheres I want only button Type 1 to be enabled.

 

 

My measure:

Selected Navigation = IF(HASONEFILTER(Questions[Navigation]), IFERROR(VALUES(Questions[Navigation]),VALUES(Questions[Navigation])),IF(HASONEFILTER(Questions[Navigation]),  IFERROR(VALUES(Questions[Navigation]),VALUES( Questions[Navigation])), "Please Select a Response"))
 
This measure is used on the Conditional Formatting of the text of the button
 
Is there a way to enable only that button if I add multiple If statments? Or how to hide Button Type 2 when Type 1 question is selected?
 
I hope this makes sense.