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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
aghoffman00
New Member

DAX expression to get highlighted values from a line & stacked column chart

I have a report that contains several matrices with dimensions that can highlight a stacked column and line chart. The business requirements are: the line chart does not take up much real estate, but can use focus mode to enlarge; must show, while in focus mode, which dimensions have been clicked from the matrices in order to highlight the line/column chart; must use the highlight interaction to be able to compare selected dimensions to the entire business.

 

My idea was to create a DAX expression that concatenates distinct values of dimensional columns if those columns are filtered, else concatenate a blank string, and use this expression as dynamic input to the line/column chart title. Example: I have a table of customers and their sales with dimensional columns State, Age, and Income each comprising their own matrix. If I click New York in the State matrix, 30-35 in the Age matrix, and 100k-150k in the Income matrix, the below DAX expression will show "State: New York; Age: 30-35; Income: 100k-150k"

 

 

CONCATENATE(CONCATENATE(
IF(ISFILTERED('My Table'[STATE]), CONCATENATE(CONCATENATE("State: ", CONCATENATEX(DISTINCT('My Table'[STATE]),[STATE],",")), ";"), ""),
IF(ISFILTERED('My Table'[AGE]), CONCATENATE(CONCATENATE("Age: ", CONCATENATEX(DISTINCT('My Table'[AGE]),[AGE],",")), ";"), "")),
IF(ISFILTERED('My Table'[INCOME]), CONCATENATE(CONCATENATE("Income: ", CONCATENATEX(DISTINCT('My Table'[STATE]),[STATE],",")), ";"), "")
)

 

 

This works for visuals that have "Filter" set as the visual interaction with the matrices, but since we need to use "Highlight" I cannot use this expression as input into the chart title. Does there exist a DAX function that can get me the filtered table from another visual, so that I can do a CONCATENATEX/DISTINCT on that subset?

 

Thank you!

2 REPLIES 2
Anonymous
Not applicable

Hi @aghoffman00,

Current dax expressions were not able to get different values for the same data source field.
For your scenario, you need to create an unconnected table and use them as a source of visual, then you can write a measure formula to extract value from unconnected table records instead of current visual and use as the visual title.
Regards,

Xiaoxin Sheng

MFelix
Super User
Super User

Hi @aghoffman00 ,

 

Be aware that you are refering to different ways of interaction within Power BI.

  • Focus mode is used to increase the size of a visualization similar to a full screen mode, when you do this you don't have the ability to get data from other visuals interactions because you click on the visualization to enter focus mode the click you have done on the other visualization gets "cancelled"
  • Highlight mode is a way to have interactions between several visualizations and can be combined using CTRL to select different data points and then the other visualizations get filter/highlighted accordingly.
  • In summary you cannot have a Highlited visualization on focus mode.

The way to have this done is instead of using the matrix visualizations to selected your parameters in slicers that way when you go to focus mode you will get the filtered information and the desired result and can have a dinamic title.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors