Forum Discussion
Adjust value for one row
I have a dashboard where the data is updated from another system every other hour. This includes a large table with data that is used in the dashboard. Now there is one value (one column) for one row that is wrong and should be adjusted. Unfortunately I can not update it in the source system so I need to adjust in the dashboard. As the source data is updated every other hour I can not adjust the source file but need to adjust in PBI. Is there a way to maybe do this in PowerQuery? I'm so far unable to think about a good option that would work.
Current table (which has 500+ rows like this):
| ID | Name | Date | Year |
| 12380 | Issue1 | 2023-03-10 | 2023 |
What it should be:
| ID | Name | Date | Year |
| 12380 | Issue1 | 2024-03-10 | 2024 |
You can create a new column name using M-Code in advanced editor, make sure you re[;ace YourSourceHere with the actual source step of your query
let
Source = YourSourceHere,
#"Added Conditional Column" = Table.AddColumn(Source, "AdjustedDate", each if [ID] = 12380 then #date(2024, 3, 10) else [Date], type date),
#"Removed Original Column" = Table.RemoveColumns(#"Added Conditional Column",{"Date"}),
#"Renamed Columns" = Table.RenameColumns(#"Removed Original Column",{{"AdjustedDate", "Date"}})
in
#"Renamed Columns"
4 Replies
- bhanu_gautamSuper User
Roym , Does value need to be changed for this particular ID or for all rows
- RoymHelper IV
Only this specific id. The rest of the rows/id's should be left unchanged
- bhanu_gautamSuper User
You can create a new column name using M-Code in advanced editor, make sure you re[;ace YourSourceHere with the actual source step of your query
let
Source = YourSourceHere,
#"Added Conditional Column" = Table.AddColumn(Source, "AdjustedDate", each if [ID] = 12380 then #date(2024, 3, 10) else [Date], type date),
#"Removed Original Column" = Table.RemoveColumns(#"Added Conditional Column",{"Date"}),
#"Renamed Columns" = Table.RenameColumns(#"Removed Original Column",{{"AdjustedDate", "Date"}})
in
#"Renamed Columns"