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! Learn more

Reply
Camod8
New Member

9 + Parameters, Dax function if two column Variables match!

Writing as a DAX newbie!

 

I am trying to use 9 Parameters (What if) user inputs to change a measured calculate.

 

The idea is simple, if there are two variables, like the table below:

 

StoreProductAVG. Price

A

A100
AB110
AC120
BA80
BB90
BC100
CA120
CB130

 

Each combination for Store & Product has its own Parameter Slider.

 

The user input would calculate sales as a measure.

 

Param.PNG

Would get you:

 

StoreProductAVG. PricePARAMSales

A

A1003300
AB1102220
AC1201120
BA8000
BB9000
BC10000
CA12000
CB13000

 

I am unable to post the PBIX file, but I have put some of my original thoughts below!

 I am not able to get DAX to work, as i am still learning the functions.

 

1. What would be the best practice for this exercise?

2. Would you be able to provide a DAX example for this provided example?

 

Spoiler

I have tried to create a measure that calculates profit for store A Products 1-3 using the params to the left.

 

Originally starting with DAX (not familiar)

 

IF(

SELECTEDVALUE('Table'[Store])="A" && SELECTEDVALUE('Table'[Product])="A",

SELECTEDVALUE('Store A _ Product A'[Store A _ Product A])*

SELECTEDVALUE('Table'[Average Price]),

0)

 

 

The Idea is to change the amount sold for the 9 variations using user inputs!

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Camod8 , Try a measure like

Switch(True() ,
max(Table[Store]) = "A" && max(Table[Product]) = "A", average(Table[AVG. Price])* selectedvalue(Table[param1])
max(Table[Store]) = "A" && max(Table[Product]) = "B", average(Table[AVG. Price])* selectedvalue(Table[param2])
max(Table[Store]) = "A" && max(Table[Product]) = "C", average(Table[AVG. Price])* selectedvalue(Table[param3])

)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Camod8 , Try a measure like

Switch(True() ,
max(Table[Store]) = "A" && max(Table[Product]) = "A", average(Table[AVG. Price])* selectedvalue(Table[param1])
max(Table[Store]) = "A" && max(Table[Product]) = "B", average(Table[AVG. Price])* selectedvalue(Table[param2])
max(Table[Store]) = "A" && max(Table[Product]) = "C", average(Table[AVG. Price])* selectedvalue(Table[param3])

)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you!!!!

 

@amitchandak !!!

 

This worked perfect!

 

 

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