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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.