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

"What If" parameters to simulate Sales

Hello everyone

 

I setup 2 "What If" paramaters to let user to choose %discount of product A and B. When user choose discount, I would like to get these %discount to silumate sales. The problem is I cannot match each parameter to product in table, so I cannot calculate sales using %discount choose by user. I also attach picture to make more clear. Please kindly advise. Thank you very much.

 

Sobsawat S.

 

SalesSimulations.jpg

1 ACCEPTED SOLUTION
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @sobsawats,

Based on my test, you can refer to below steps:

1.I have entered some sample data to test for your problem like the picture below:

1.PNG

2.

Create two “What If” parameters and three measures.

Discount = IF(CALCULATE(MAX([Product])="A"),[A Value]/100,IF(CALCULATE(MAX([Product])="B"),[B Value]/100))

New price = CALCULATE(SUM(Table1[List Price]))-(CALCULATE(SUM(Table1[List Price]))*[Discount])

New sales = CALCULATE(SUM(Table1[Sales]))-(CALCULATE(SUM(Table1[Sales]))*[Discount])

3.Create a Table visual and add the related fields and you can see the result.

2.PNG

You can also download the PBIX file to have a view.

https://www.dropbox.com/s/fqqfjuoedjdy470/%27What%20If%27%20parameters%20to%20simulate%20Sales.pbix?...

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @sobsawats,

Based on my test, you can refer to below steps:

1.I have entered some sample data to test for your problem like the picture below:

1.PNG

2.

Create two “What If” parameters and three measures.

Discount = IF(CALCULATE(MAX([Product])="A"),[A Value]/100,IF(CALCULATE(MAX([Product])="B"),[B Value]/100))

New price = CALCULATE(SUM(Table1[List Price]))-(CALCULATE(SUM(Table1[List Price]))*[Discount])

New sales = CALCULATE(SUM(Table1[Sales]))-(CALCULATE(SUM(Table1[Sales]))*[Discount])

3.Create a Table visual and add the related fields and you can see the result.

2.PNG

You can also download the PBIX file to have a view.

https://www.dropbox.com/s/fqqfjuoedjdy470/%27What%20If%27%20parameters%20to%20simulate%20Sales.pbix?...

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-danhe-msft

 

It's work. Thank you so much.

 

Note:

I change IF to SWITCH to shorten formula in case I have many many product in the list.

Discount2 = SWITCH(CALCULATE(MAX([Product])),"A",[A Value]/100,"B",[B Value]/100)

Hello @v-danhe-msft

 

Thank you for your reply.The key is MAX().

I will study your solution and provided material, and will feed back soon.

 

Thanks again,

Sobsawat S.

Hi @sobsawats,

Ok, if your problem has been solved, could you please mark my helpful reply as Answered?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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!

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
Top Kudoed Authors