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! Request now

Reply
elia22gr
Helper III
Helper III

Use measure where it's output is a column's name in another formula instead of the column itself

Hi all,

 

I have a Power BI Report and I need your help in this problem

I want to make a dynamic title for my visual (is something that I do all the time) but now I have this problem...I have used a field parameters double slicer (one as it comes when you create the parameter and the second by showing the selected field (and more specific the previous in the hierarchy category).

 

Now I writing this dax in a measure

VAR ProductHierarchyValues = VALUES('Products Hierarchy'[Products Hierarchy Fields]) which returns the column name and I want this output to be used in the following DAX formula
VAR ProductHierarchy = CONCATENATEX(VALUES(COLUMN(ProductHierarchyValues)),ProductHierarchyValues,", ",ProductHierarchyValues,ASC) instead of hardcopy the column name and using SWITCH formula with too many arguments. How can I pass the output of the first variable to the second wherever a column name is needed?
The Products Hierarchy table is as pictured above and is a result of the use of field parameters
elia22gr_0-1670489678265.png

I use a single-select slicer in my report so the VAR ProductHierarchyValues = VALUES('Products Hierarchy'[Products Hierarchy Fields]) will return a single value. I want this value to be used in my second variable VAR ProductHierarchy = CONCATENATEX(VALUES(COLUMN(ProductHierarchyValues)),ProductHierarchyValues,", ",ProductHierarchyValues,ASC) and dynamicaly change it.

 

Thank you in advance,
Eleftheria
2 REPLIES 2
elia22gr
Helper III
Helper III

@lbendlin This column 'Products Hierarchy'[Products Hierarchy Fields] used in this variable VAR ProductHierarchyValues = VALUES('Products Hierarchy'[Products Hierarchy Fields]) 

is the column outcome from the use of field parameters and holds all the column names used in this field parameter. I want to use them and dynamically change the column in the second variable expression VAR ProductHierarchy = CONCATENATEX(VALUES(COLUMN(ProductHierarchyValues)),ProductHierarchyValues,", ",ProductHierarchyValues,ASC

lbendlin
Super User
Super User

 

I writing this dax in a measure

VAR ProductHierarchyValues = VALUES('Products Hierarchy'[Products Hierarchy Fields]) which returns the column name

 

I don't think so - unless your column name references are stored in that column.

 

You might be able to do something here with field parameters. Remember that you walking on the edge of the EVALUATE precipice, so step carefully.

 

Please provide sanitized sample data that fully covers your issue.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

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