Forum Discussion

Roym's avatar
Roym
Helper IV
2 years ago
Solved

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):

IDNameDateYear
12380Issue12023-03-102023

 

What it should be:

IDNameDateYear
12380Issue12024-03-102024
  • 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

    • Roym's avatar
      Roym
      Helper IV

      Only this specific id. The rest of the rows/id's should be left unchanged

      • bhanu_gautam's avatar
        bhanu_gautam
        Super 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"