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
akhiakg
Frequent Visitor

Couldn't creat the dynamic parameter

 

Hi,

 

I've two measures Sales and Profit, but I want to create a  dynamic parameter for sales and profit, how can I do it?

 

Regards,

Akhilesh Gupta

1 ACCEPTED SOLUTION

@akhiakg,

 

Measure =
var selecteditem = MAX(Slicer[Slicer])
return if(selecteditem="Sales",MAX(Sales[Sales]),MAX(Sales[Sales])-MAX(Sales[Cost]))

change MAX to SUM

Measure =
var selecteditem = MAX(Slicer[Slicer])
return if(selecteditem="Sales",SUM(Sales[Sales]),SUM(Sales[Sales])-SUM(Sales[Cost]))

 

Regards,

Charlie Liao

View solution in original post

5 REPLIES 5
v-caliao-msft
Microsoft Employee
Microsoft Employee

@akhiakg,

 

I have tested it on my local environemnt, the steps below are for you reference.

  1. Sample data
    Capture.PNG
  2. Create a new table by enter data.
    Capture1.PNG
  3. Create a measure on Sales table
    Measure =
    var selecteditem = MAX(Slicer[Slicer])
    return if(selecteditem="Sales",MAX(Sales[Sales]),MAX(Sales[Sales])-MAX(Sales[Cost]))
  4. Use this measure in your visual.
    Capture2.PNGCapture3.PNG

Regards,

Chalrie Liao

Hello Chalrie Liao,

 

I used the logic several times, which I got from you, but not working and showing the below error in screenshot.....

 

Please suggest and how can do it.

 

Error.PNG

Regards,

Akhilesh Gupta

@akhiakg,

 

Please by using enter data

Capture.PNG

 

Regards,

Charlie Liao

Hello Charlie Liao,

 

Thanks for the quick response.  

 

 

The grand total is not matching for Profit and Sales, which I got the solution from you.

 

 

Calculation Error.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Regards,

Akhilesh Gupta

@akhiakg,

 

Measure =
var selecteditem = MAX(Slicer[Slicer])
return if(selecteditem="Sales",MAX(Sales[Sales]),MAX(Sales[Sales])-MAX(Sales[Cost]))

change MAX to SUM

Measure =
var selecteditem = MAX(Slicer[Slicer])
return if(selecteditem="Sales",SUM(Sales[Sales]),SUM(Sales[Sales])-SUM(Sales[Cost]))

 

Regards,

Charlie Liao

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