Forum Discussion
DAX Help for Custom/Conditional Column
- 4 years ago
Dear @raghukumarch ,
I have implemented your scenario, Here's the few steps to achieve the required output.
Go to Home - > Transform DataOpen the Query which contains the column C_SerialNumber.
Go to - > Add Column - > Custom ColumnNew Column Name: CheckColumn
Custom column formula: Text.Contains([C_SerialNumber],"-")
Now click on OK.Now again click on Add Column - > Custom Column
New Column Name: NewC_SerialNumber
Custom column formula: if [CheckColumn] = false then "0" & [C_SerialNumber] else [C_SerialNumber]
Now click on OK.
Now, check on the formula bar, if the type isn't set to text then write it in a way as below screen short and click on the tick.Here's the desire output in a new column.
Please like the reply and accept it as a solution to help the Power BI Community.
Dear @raghukumarch ,
I have implemented your scenario, Here's the few steps to achieve the required output.
Go to Home - > Transform Data
Open the Query which contains the column C_SerialNumber.
Go to - > Add Column - > Custom Column
New Column Name: CheckColumn
Custom column formula: Text.Contains([C_SerialNumber],"-")
Now click on OK.
Now again click on Add Column - > Custom Column
New Column Name: NewC_SerialNumber
Custom column formula: if [CheckColumn] = false then "0" & [C_SerialNumber] else [C_SerialNumber]
Now click on OK.
Now, check on the formula bar, if the type isn't set to text then write it in a way as below screen short and click on the tick.
Here's the desire output in a new column.
Please like the reply and accept it as a solution to help the Power BI Community.