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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
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.
Solved! Go to Solution.
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:
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.
You can also download the PBIX file to have a view.
Regards,
Daniel He
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:
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.
You can also download the PBIX file to have a view.
Regards,
Daniel He
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