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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Employee
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
Employee
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors