Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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
Solved! Go to Solution.
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
I have tested it on my local environemnt, the steps below are for you reference.
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.
Regards,
Akhilesh Gupta
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.
Regards,
Akhilesh Gupta
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
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 103 | |
| 80 | |
| 62 | |
| 50 | |
| 45 |