Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I want to make new column in which I want to put the content of an existing colomn "A" or the content from the previous row of the new colom depending on the content of column "A".
In Excel I can use this formula: IF(left(A2;1)="-";C1;B2)
I've tried several options (even chat GPT) but it won't work.
Kind regards,
Domien
Solved! Go to Solution.
watch my video and you will find out how to do this
watch my video and you will find out how to do this
Thanks!. This works perfect for me!!
@Domien Hello,
you can refer this dax.
Create a column then create the same measure and replace the result and alternate result column.
@Domien Hello,
I meant this.
Hi Harish,
I'm sorry but I don't know what you mean
Thanks, for the quick reply.
I've tried something simular but when I use your solution I get errors whent the first character is an "-"
I've used this formula. I've checked the column names so that could not be the problem
In Power Query, you can create a new column that depends on the content of an existing column "A" or the content from the previous row of the new column based on the content of column "A." You can achieve this using the following steps:
Open Power Query Editor in Power BI or Excel.
Select your table that contains column "A."
Go to the "Add Column" tab and click on "Custom Column."
In the "Custom Column" dialog box, enter a name for the new column (e.g., "NewColumn").
In the "Custom column formula" box, enter the following formula:
if Text.Start([A], 1) = "-" then [NewColumn]{[Index]-1} else [A]
This formula checks if the first character of column "A" is "-", and if it is, it retrieves the value from the previous row of the "NewColumn"; otherwise, it takes the value from column "A."
This will create a new column "NewColumn" that meets your specified conditions. If the first character of column "A" is "-", it will take the value from the previous row of "NewColumn"; otherwise, it will take the value from column "A."
User | Count |
---|---|
93 | |
83 | |
77 | |
70 | |
65 |
User | Count |
---|---|
114 | |
101 | |
96 | |
65 | |
60 |