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.
Im looking for a measure formula
I have a data table. In this table I have a column called account type (text).
In this ‘table’ I also create a measure (number).
What I would like to have: if the account type column=rev my measure need to multiple by -1, otherwise I need to show my original measure value.
In excel it’s a simple IF AND , however in PowerBI looks like to me for if and I can only use my measures as a variable, not the columns that already exist? Am I right?
When I tried to create if and formula I have the following error.a single vales for column accont type in table cannot be determined.
Solved! Go to Solution.
@Anonymous , Try like
new Measure =
calculate(-1*[measure],[account type] = "rev")+ calculate([measure],[account type] <> "rev")
@Anonymous , Try like
new Measure =
calculate(-1*[measure],[account type] = "rev")+ calculate([measure],[account type] <> "rev")
hi all
thank you @az38 I am not an expert in powerBI but when I tried to copy your technique, I had an error.
thank you@amitchandak, I also try this solutions and its worked
THank you 4 everybody!
Hi @Anonymous
try this technique
Measure =
var _type = MAX(Table[account type])
var _measure = --YOURMEASURESTATEMENT--
RETURN
IF(_type = "rev", -1 * _measure , _measure )
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 |
---|---|
115 | |
99 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |