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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.