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.
Hi all!
I have two percentage columns:
Return Rate 1
Return Rate 2
I need to create two Measures to calculate:
Measure 1=
IF RT1 = 0, Return Text "N/a"
IF RT1 > RT2, Return Text "Out P"
IF RT2 < RT2, Return Text "Under P"
Measure 2=
IF RT1 = 0, Return Text "N/a"
IF RT1 > RT2, Return calculated value
IF RT2 < RT2, Return calculated value
Thank You!
Solved! Go to Solution.
Hi @Anonymous ,
Some data I created:
Here are the steps you can follow:
Create measure.
Measure1 =
IF(
MAX('Table'[Rate1])=0,"N/a",
IF(MAX('Table'[Rate1])>MAX('Table'[Rate2]),"Out P","Under P"))
Result:
Measure2 =
IF(
MAX('Table'[Rate1])=0,"N/a",
IF(MAX('Table'[Rate1])>MAX('Table'[Rate2]),MAX('Table'[Rate1])-MAX('Table'[Rate2]),MAX('Table'[Rate1])+MAX('Table'[Rate2]))
)
Result:
When rate1=0, return "n/a", when rate1>rate2, return rate1 rate2, and rate1 + rate2 when rate1 > rate2
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Some data I created:
Here are the steps you can follow:
Create measure.
Measure1 =
IF(
MAX('Table'[Rate1])=0,"N/a",
IF(MAX('Table'[Rate1])>MAX('Table'[Rate2]),"Out P","Under P"))
Result:
Measure2 =
IF(
MAX('Table'[Rate1])=0,"N/a",
IF(MAX('Table'[Rate1])>MAX('Table'[Rate2]),MAX('Table'[Rate1])-MAX('Table'[Rate2]),MAX('Table'[Rate1])+MAX('Table'[Rate2]))
)
Result:
When rate1=0, return "n/a", when rate1>rate2, return rate1 rate2, and rate1 + rate2 when rate1 > rate2
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous
I did not understand
Measure 1 =
var rt1 = SELECTEDVALUE(Table12[RT1])
VAR rt2 = SELECTEDVALUE(Table12[RT2])
return
SWITCH( TRUE(),
rt1 = 0, "N/a",
rt1 > rt2, "Out P",
rt2 < rt1, "Under P"
)
If you want to use it as a column:
Measure 1 =
var rt1 = Table12[RT1]
VAR rt2 = Table12[RT2]
return
SWITCH( TRUE(),
rt1 = 0, "N/a",
rt1 > rt2, "Out P",
rt2 < rt1, "Under P"
)
the 2nd Measure you wanted. For the 1st measure, please use the following:
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
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 |
---|---|
106 | |
94 | |
76 | |
62 | |
50 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |