Forum Discussion
Replace values of multiple columns using m code power bi
- 4 years ago
Hi Anonymous ,
Multi-select (Ctrl+click) all colums that are not your date columns.
Go to Transform tab > Unpivot Columns > Unpivot Other Columns.
Perform your replace function on the new [Value] field.
Re-pivot [Attribute] column using [Value] as population field if you want *.
* As a side note, the data structure after you have done the first Unpivot operation is the generally-accepted correct data structure. Having separate columns for each date is unwieldy and will not scale well. Additionally, the structure you currently have will make it very difficult to create relationships and write measures.
Pete
Hi Anonymous ,
Multi-select (Ctrl+click) all colums that are not your date columns.
Go to Transform tab > Unpivot Columns > Unpivot Other Columns.
Perform your replace function on the new [Value] field.
Re-pivot [Attribute] column using [Value] as population field if you want *.
* As a side note, the data structure after you have done the first Unpivot operation is the generally-accepted correct data structure. Having separate columns for each date is unwieldy and will not scale well. Additionally, the structure you currently have will make it very difficult to create relationships and write measures.
Pete