Forum Discussion

Vinothsusai's avatar
Vinothsusai
Icon for Helper III rankHelper III
7 years ago

How to update value in current row column based on the another row column value condition in Mquery

Hi,

I am new into power bi. 

How can we update value in current row column based on the another row column value condition in Mquery.

Actual Table

 

IDMainAccountMappingID
1R001 
2 1
3R003 
4 3
5R005 
6R006 
7 5

 

Here I want to update the MainAccount value to the MainAccount column based on the Mapping ID

Expected Table.

IDMainAccountMappingID
1R001 
2R0011
3R003 
4R0033
5R005 
6R006 
7R0055

 

Please advise.

 

Thanks

Vinoth S

4 Replies

  • v-xicai's avatar
    v-xicai
    Icon for Community Support rankCommunity Support

    Hi,

     

    You can create column or measure like DAX below

     

    Expected_Column = IF(Table1[MainAccount]<>BLANK(),Table1[MainAccount],CONCATENATE("R00",Table1[MappingID]))
     
    Expected_Measure = IF(MAX(Table1[MainAccount])<>BLANK(),MAX(Table1[MainAccount]),CONCATENATE("R00",MAX(Table1[MappingID])))

     

     

     

     

     

     

     

    Best Regards,

    Amy

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    • Vinothsusai's avatar
      Vinothsusai
      Icon for Helper III rankHelper III

      Hi,

      Thank you for your reply.

      Is it possible to achieve this in query editor.

       

       

      Thanks

      Vinoth SUSAINATHAN

      • v-xicai's avatar
        v-xicai
        Icon for Community Support rankCommunity Support

        Hi Vinothsusai ,

         

        Sorry, I can't figure out how to achieve it in query editor. Maybe someone others can have a try.

         

        Best Regards,

        Amy

         

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly