Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hello everyone,
I have a table where I have a price for each product. The goal is to calculate new price for selected values using a value chosen from parametar. For example, I have the following table:
Product | Price |
A | 0.4 |
B | 0.1 |
C | 0.3 |
Using the filter, I am for example choosing only A and C as products (the filter should not filter the whole table, but just to select the following products), and using parametar filter I am increasing the price from 0.4 to 0.5 and 0.3 to 0.4 respectively to products A and C with the following new table,
Product | Old price | New price |
A | 0.4 | 0.5 |
B | 0.1 | 0.1 |
C | 0.3 | 0.4 |
I have tried using a separate table that is not connected by product name, and I wanted to compare the names of the two different tables (products, orders - in products I have the product names and in orders I have the all orders for the products and their prices).
I have using the following DAX to see if the selected product name is the same as the one in orders name so that I could recalculate the new price.
IF(CALCULATE(SELECTEDVALUE(Orders[Product])=SELECTEDVALUE(Products[Name])),
SELECTEDVALUE('Increase Price'[Increase Price]) * Prodcts[Price (piece)] + Products[Price (piece)], Products[Price (piece)])
If you have any questions, please let me know.
Thanks in advance.
Kind regards,
Stefani
Solved! Go to Solution.
Hello @lbendlin ,
Thank you for your answer, actually I solved the problem like this:
IF(SELECTEDVALUE(Orders[Product]) IN VALUES(Products[Name]), [Price (piece)]*Percentage[Percentage value] + [Price (piece)], [Price (piece)])
but now actually I have the problem with the summarization. The summary takes all of the values as one not row by row..
Do you know maybe the solution to that problem?
Thank you very much.
Kind regards,
Stefani
Using a disconnected table is the right first step. The next step is to figure out which products the user has selected. For that you can use FILTERS, and then you can check if the product in the current context intersects with the result. If yes, apply the uplift, if no, keep the original price.
Hello @lbendlin ,
Thank you for your answer, actually I solved the problem like this:
IF(SELECTEDVALUE(Orders[Product]) IN VALUES(Products[Name]), [Price (piece)]*Percentage[Percentage value] + [Price (piece)], [Price (piece)])
but now actually I have the problem with the summarization. The summary takes all of the values as one not row by row..
Do you know maybe the solution to that problem?
Thank you very much.
Kind regards,
Stefani
I should have used SUMX instead of SUM, when summing up measures.
User | Count |
---|---|
86 | |
82 | |
68 | |
64 | |
55 |
User | Count |
---|---|
120 | |
99 | |
91 | |
83 | |
65 |