cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Sathvik123
Helper V
Helper V

Parameters in Power BI

Hello All,

 

I am new to Power BI.

I have a page where I need to show my measure names based on a parameter

 

If parameter ='Sales' then sales value

else parameter ='Profit' then profit

 

I am not sure how to do this.

Could any one please help

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @Sathvik123 

It sounds like dynamic measure name, however, the name of column or measure cannot be changed dynamically in Power BI Desktop. You can use slicer, then select the measures according to the slicer. In this scenario, it will not change the name of the measure, but the calculation expression.

For example,

(1) the measure below returns [Profit] when you select "Profit" in Slicer, as is "Sales"

vxiaotang_0-1648105685713.png

(2) Besides, you can use title function of that visual

Steps:

 

TitleMeasure = 
SWITCH(TRUE(),
MIN(Slicer[Column1])="Profit","Profit",
MIN(Slicer[Column1])="Sales","Sales")

 

vxiaotang_1-1648105951537.png

result

vxiaotang_2-1648106002809.png

Best Regards,

Community Support Team _Tang

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

View solution in original post

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @Sathvik123 

It sounds like dynamic measure name, however, the name of column or measure cannot be changed dynamically in Power BI Desktop. You can use slicer, then select the measures according to the slicer. In this scenario, it will not change the name of the measure, but the calculation expression.

For example,

(1) the measure below returns [Profit] when you select "Profit" in Slicer, as is "Sales"

vxiaotang_0-1648105685713.png

(2) Besides, you can use title function of that visual

Steps:

 

TitleMeasure = 
SWITCH(TRUE(),
MIN(Slicer[Column1])="Profit","Profit",
MIN(Slicer[Column1])="Sales","Sales")

 

vxiaotang_1-1648105951537.png

result

vxiaotang_2-1648106002809.png

Best Regards,

Community Support Team _Tang

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

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors