Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have 2 columns, one is the product_id & the other is the GM%,
I need to create the below calculated column or a measure with the below formaula:
If(GM%<10,"0",
IF(GM%<20,"Divide(GM%,2)",
"10"
))
But the output of (if) is text, i couldn't make a calculation.
How could you help me?
Regards
Solved! Go to Solution.
Hello @Maahmohammed ,
Please try the below measure I have used Switch instead of "IF" which is more readable.
AdjustedGMMeasure =
SWITCH(TRUE(),
SUM(Table[GM]) < 10, 0,
SUM(Table[GM]) < 20, DIVIDE(SUM(Table[GM]), 2),10)
If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes are much appreciated!
Thank You
Dharmendar S
Make sure that the data format of the "GM%" column is a numeric type.
In my simple test, the measure works.
Also, the SWITCH function suggested in dharmendars007's reply is a valid solution.
AdjustedGM% = IF(SELECTEDVALUE('Table'[GM%]) < 10, 0, IF(SELECTEDVALUE('Table'[GM%]) < 20, DIVIDE(SELECTEDVALUE('Table'[GM%]), 2), 10))
Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Just a friendly follow up on the case, may I know if these replies have helped you resolve the issue? If they have, please consider accepting helpful reply as a solution.
Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @Maahmohammed ,
Please try the below measure I have used Switch instead of "IF" which is more readable.
AdjustedGMMeasure =
SWITCH(TRUE(),
SUM(Table[GM]) < 10, 0,
SUM(Table[GM]) < 20, DIVIDE(SUM(Table[GM]), 2),10)
If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes are much appreciated!
Thank You
Dharmendar S
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.