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.
Hello!
Anyone could help me, pls? I need to multiply two values, but they have a conditional. For example: I need to multiply the number of fruits per some tax, but the tax depends of the kind of fruit, like
(
Fruit Type Count of fruits TAX Value
Apple 500 0.2 X
Banana 200 0.1 Y
Orange 350 0.5 Z
How can I obtain X, Y and Z? There is any way, without creat a filtered value for each fruit and than, multiply per Fruit Tax?
Solved! Go to Solution.
Information provided in a couple of posts, not making it clear. But summarize can help if data is at multiple levels
sumx(summarize(Table,Table[Fruit Name],"_Sum",sum(Table[Fruit Qty]),"_Max",Table[Tax]),[_Sum]*[_Max])
Information provided in a couple of posts, not making it clear. But summarize can help if data is at multiple levels
sumx(summarize(Table,Table[Fruit Name],"_Sum",sum(Table[Fruit Qty]),"_Max",Table[Tax]),[_Sum]*[_Max])
Thank You so much! 🙂
It worked - I just replace Table[Tax] per its expression - I could not call it directly since it is a calculated columm and wasnt allowed when I tried here.
Could you split the data into two tables?
One with Fruit name and corresponding tax and the other with fruit name, cnt of fruits. Define a relationship based on fruits column and create a measure directly. Please post complete sample input data. I could not related the measure you have with the provided sample.
@VasTg I can split - one table with "fruit_name" and Quantity and other table with "fruit_name" and its taxes and use a related function. The problem is that quantity is a calculated value and taxes is a function that depends of fruit type.
I can't share my data, it's confidential, but i will try to give a better example:
register_id type_of_fruit col_3 col_4 col_5
4512d banana ... ... ...
s345c3 apple
457120 orange
48762w apple
Then, I created some calculated measures: Banana_tax, Orange_tax, Apple_tax as float numbers (ex: Banana_tax = 0,07).
And so, I created a calculated columm, with the conditional I wrote before, to define the correct tax for each fruit. Finally, I want to multiply the correct tax X count(register_id) for each type of fruit.
I tried to use so many aproaches, but none worked until now 😞
Hi @nataliafm31
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
99 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |