Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
DanielBragg91
Regular Visitor

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
 
1 ACCEPTED SOLUTION
olgad
Super User
Super User

Hi, take a look at this article to see how i group columns under one field parameter to bring with one click the columns that i would like to display.
https://www.linkedin.com/pulse/field-parameters-case-measure-groups-olga-dontsova/?trackingId=wFMbN2... 

Let me know if you have further questions.


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

View solution in original post

3 REPLIES 3
DanielBragg91
Regular Visitor

That worked a treat! Thank you so much

olgad
Super User
Super User

Hi, take a look at this article to see how i group columns under one field parameter to bring with one click the columns that i would like to display.
https://www.linkedin.com/pulse/field-parameters-case-measure-groups-olga-dontsova/?trackingId=wFMbN2... 

Let me know if you have further questions.


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

Hi,

 

Need help with Dynamic column header

I have attached the screenshot where have set of columns and created measure for all separate column.

When I select Month and Year it has to show same as screenshot.

Is there any way I can do it in Power BI desktop. Please let me know

anushaghi123_1-1706107212003.png

 

Thanks

 

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors