Forum Discussion
Create Calculated Column with Conditions
- Anonymous4 years ago
Hi Anonymous ,
I think you can try this code to create a calculated column.
Calculated Column with Conditions = VAR _COUNT_15 = CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[NOMBRES] ), 'Table'[LIQ] = 15 ) ) VAR _COUNT_Lessthan_15 = CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[NOMBRES] ), 'Table'[LIQ] < 15 ) ) RETURN IF ( _COUNT_Lessthan_15 = 1, 1, _COUNT_15 )Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
See if this calculated column formula works
Count = calculate(countrows(Data),filter(Data,Data[Nombres]=earlier(Data[Nombres])&&Data[LIQ]=earlier(Data[LIQ])))
Hope this helps.
Good morning, is that formula to create a calculated column or a measure? I want to create a calculated column with those conditions.
- Ashish_Mathur4 years agoSuper User
Hi,
As mentioned in my earlier message, mine is a calculated column formula.
- Anonymous4 years agoNot applicable
Thank you very much, but the formula only prints the duplicate results, that is, if there are 2 duplicates, it gives me the number 2 or if there are 3, it gives me the number 3
But I want that if the number is If a name has 2 times 15, I want to put the number 2
If it is less than 15, let me put 1
- Ashish_Mathur4 years agoSuper User
Hi,
Try this calculated column formula
Calc = if(Data[LIQ]<15,1,if(Data[Count]=2,2,""))