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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Employee
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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.