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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.