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.
@Phil_Seamark - calling on you for your power BI wizard-like capabilities!
I am trying to write what I think would be a simple DAX function without an operation.
Two columns:
Calculation should be Customer Spend/Cost per Thousand * 1000 = Number of Units
Any suggestions...when I put an operation in front of the numerator and denominator the calculation works, but I get an incorrect answer.
Johnny has a $500 budget to purchase apples. The cost for apples is $20 cost per thousand. How many apples can Johnny buy based on his budget. $500/$20*1000 = 25,000 apples.
Solved! Go to Solution.
@irnm8dn I'm assuming you have a table with each row having a cost per thousand and a price and you are trying to calculate units for each row? You need a calc column for something like that, unless you are trying to evaluate the expression for every row AND THEN summarize (i.e. sum, average etc.) in which case you could use a SUMX or similar function.
In any event, once you load your data to the data model, you can use DAX by right clicking on the table name and choosing Calculated Column. Then write your function.
I would recommend doing simple calc columns like this in query editor if possible. You will get better compression and performance of the data model if you add the column there rather than with DAX.
what are you expecting?
measure = divide($500, ($20 * 1000))
Proud to be a Super User!
@irnm8dn I'm assuming you have a table with each row having a cost per thousand and a price and you are trying to calculate units for each row? You need a calc column for something like that, unless you are trying to evaluate the expression for every row AND THEN summarize (i.e. sum, average etc.) in which case you could use a SUMX or similar function.
In any event, once you load your data to the data model, you can use DAX by right clicking on the table name and choosing Calculated Column. Then write your function.
I would recommend doing simple calc columns like this in query editor if possible. You will get better compression and performance of the data model if you add the column there rather than with DAX.
I think this should be a calc column not a measure. Is that what you have tried?
I haven't tried that. Can you offer some details on how to do, and the expression itself?
Thank you!
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |