Forum Discussion
evalromf
9 years agoHelper I
AND IF in conditional column
Hi, I'm trying to create a new column that should be populated with a certain number based on the contents of several other columns. What I'm looking for is something like this: If [COUNT...
GilbertQ
6 years agoSuper User
Hi there
I would suggest first to simplify your model design if you are trying to achieve this from 2-3 different tables. Ideally all that information would be contained in 1 table.
The challenge is that when creating a measure it does not work on a column basis but rather works on returning a single scalar value. With the IF condition it still expects to get a single value once evaluated?
I would suggest first to simplify your model design if you are trying to achieve this from 2-3 different tables. Ideally all that information would be contained in 1 table.
The challenge is that when creating a measure it does not work on a column basis but rather works on returning a single scalar value. With the IF condition it still expects to get a single value once evaluated?
Anonymous
6 years agoNot applicable
GilbertQ Below is the error i am getting. Now i am getting the data from 2 tables project, staff and calendar table is also used. Can you now suggest on this.
ErrorProjectSchema
- GilbertQ6 years agoSuper UserHi there
It is because the IF statement only accepts a single value to compare. You need to change the context to be using a measure value and not a column value.
- Anonymous6 years agoNot applicable
Can you please explain how can i implement the below logic now:
if(billingmethod= "FP" then use Measure1 else use Measure2)
- GilbertQ6 years agoSuper UserYou could try it with a Variable such as below
My Measure =
VAR ValueToGet = SELECTEDVALUE(TableName[BillingMethod])
RETURN
IF(ValueToGet = "FP", [Total_Invoice].[Total_InvoiceTM])