Forum Discussion

DanielBragg91's avatar
DanielBragg91
Regular Visitor
3 years ago
Solved

Dynamically changing matrix column headers based on slicer value

Hi

 

I want to be able to display a matrix with and without some columns based on a slicer selection.

 

So far I've managed to create two field parameters "HeadersIncQuotes" and "HeadersExcQuotes" containing the headers I will need in each view. I've then tried to create a new calculated table that chooses between these two field parameters depending on a selected value but I'm running into errors:

 

Headers = SWITCH(SELECTEDVALUE(select_Quote[SelectQuote],"abc"),"Yes",CALCULATETABLE(HeadersIncQuotes),"No",CALCULATETABLE(HeadersExcQuotes))
 
"The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."
 
Am I on the right track here? Or is there a better way of doing this? I already explored using buttons and bookmarks to change the matrix displayed on my visual, but I want to go down the slicer route because the my slicer selection also feeds into some measure calculations and I don't want two separate selections to be made (one for the visualisation displayed and one for the measure calculations).
 
Thanks
Dan
 

3 Replies