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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.