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.
I think this is real simple but I can't seem to figure it out. I have one column with a list of text values and based on those values, I want a certin numeric value to appear in a new calculated column. Below is an example:
Likert Scale | Associated Value |
Strongly Disagree | 1 |
Disagree | 2 |
Neutral | 3 |
Agree | 4 |
Strongly Agree | 5 |
NA | 6 |
What is the DAX formula to get the associated value to appear based on the text in the likert scale column?
Solved! Go to Solution.
Found a solution:
Found a solution:
Evaluates an expression against a list of values and returns one of multiple possible result expressions.
SWITCH(<expression>, <value>, <result>[, <value>, <result>]…[, <else>])
Term | Definition |
---|---|
expression | Any DAX expression that returns a single scalar value, where the expression is to be evaluated multiple times (for each row/context). |
value | A constant value to be matched with the results of expression. |
result | Any scalar expression to be evaluated if the results of expression match the corresponding value. |
else | Any scalar expression to be evaluated if the result of expression doesn't match any of the value arguments. |
But you might also consider creating a dimension table that had the text values in one column and the numeric values in the other. If you relate the dimension table to your fact table you will get direct access to the numeric value thru the relationship.
Help when you know. Ask when you don't!
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 |
---|---|
107 | |
97 | |
75 | |
65 | |
53 |
User | Count |
---|---|
144 | |
103 | |
98 | |
85 | |
64 |