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 guys,
If I have this table
how to add custom column saying that If [Toggle] = 1 then [Value]/10 else [Value]/10 * -1
I found the If statement only allow a fixed value, is that correct?
I'm sorry but I never use Power query or M language before.
Thanks.
Solved! Go to Solution.
Hello @admin_xlsior
what you mean by fixed value?
the first parameter you can use also a list or table by applying a function like
if Table.RowCount(YourTable)= 1 then ....
and for the then end else you can use let/in and functions as well like
if [Toggle]=1 then
let
FirstStep = .....,
SecondStep = FirstStep + 1
in
SecondStep
else
null
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy
Hello @admin_xlsior
what you mean by fixed value?
the first parameter you can use also a list or table by applying a function like
if Table.RowCount(YourTable)= 1 then ....
and for the then end else you can use let/in and functions as well like
if [Toggle]=1 then
let
FirstStep = .....,
SecondStep = FirstStep + 1
in
SecondStep
else
null
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy
hmm, yeah, I don;t know why it show error back then, but now is ok
Ok, thanks for comfirming.
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 |
---|---|
102 | |
53 | |
21 | |
12 | |
12 |