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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
feralvarez994
Helper II
Helper II

Change dax name by selecting value

Hi everyone! I have a SWITCH dax that returns different values depending on the user selection, the thing is that i want to show different names by the value chosed by the user. This is the syntax of the dax used

 

Variable =
var variable = SWITCH( TRUE(), [Selected Metric] = "Bruto" && [Selected Moneda] = "Pesos", [Bruto Total],
[Selected Metric] = "Neto" && [Selected Moneda] = "Pesos", [Neto Total],
[Selected Metric] = "Costo Total" && [Selected Moneda] = "Pesos", [Costos Total],
[Selected Metric] = "Bruto" && [Selected Moneda] = "Dolares", [Bruto USD],
[Selected Metric] = "Neto" && [Selected Moneda] = "Dolares", [Neto USD],
[Selected Metric] = "Costo Total" && [Selected Moneda] = "Dolares", [Costo Total / USD])

return IF(ISBLANK(variable), 0, variable)
 
feralvarez994_0-1654878724058.png

 

The thing is that when i show that Variable in the Table, it shows always the same title ("Variable") and i want it to retrieve different name by the Metric chosed before (Bruto/Neto/Costo Total)
 
Thank you everyone!
3 REPLIES 3
v-yanjiang-msft
Community Support
Community Support

Hi @feralvarez994 ,

Is your problem solved?? If so, Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.

Best Regards,
Community Support Team _ kalyj

v-yanjiang-msft
Community Support
Community Support

Hi @feralvarez994 ,

According to your description, your formula is not creating a dynamic measure name, but dynamic value based on different condition. As @ribisht17  mentioned, dynamic measure name can't be created. If you want to get the expected result, you can create a new table like this:

vkalyjmsft_0-1655367912673.png

Put it in the Matrix Columns, then create a measure use SWITCH like yours to calculate the different values according to the new column.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

ribisht17
Community Champion
Community Champion

@feralvarez994 

 

 There are no dynamic names for measures.

As of now only you can have a dynamic table/visual title.

You can vote for an idea or log a new one. https://ideas.powerbi.com/ideas/

 

Regards,

Ritesh

Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
My YT Channel Dancing With Data !! Connect on Linkedin !!Power BI for Tableau Users 

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!