Forum Discussion

BishwaR's avatar
BishwaR
Helper V
4 years ago
Solved

Duplicate Columns

I have two columns one With Customer Name other With Salary. I need to create duplicates with different names by using DAX.

I used the following dax CALCULATE(MAX(CUSTOMER NAME)) but I was not able to get the exact rows.

 

CUSTOMER NAME         SALARY        DUPLICATE COL1       DUPLICATE COL2

JOHN                            $3000             JOHN                            $3000

GRACY                          $4000             GRACY                          $4000

AMBER                         $1600              AMBER                         $1600

 

I do not want to use power query to create these duplicate columns

 

Thanks

 

  • Hi BishwaR ,
    You do not specify, but you can write two measures.
    Let me know if you have any questions.

    If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πŸ‘are nice too.
    Nathaniel

    Dup Name = Max ('Table (6)'[Name])
    Dup Salary= Max ('Table (6)'[Salary])

     



8 Replies

  • Nathaniel_C's avatar
    Nathaniel_C
    Community Champion

    Hi BishwaR ,
    You do not specify, but you can write two measures.
    Let me know if you have any questions.

    If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πŸ‘are nice too.
    Nathaniel

    Dup Name = Max ('Table (6)'[Name])
    Dup Salary= Max ('Table (6)'[Salary])

     



    • BishwaR's avatar
      BishwaR
      Helper V

      Thank you but in my actual table the names are repeated so when I used the max it is showing some blanks.

      How to populate data in the black rows. Thanks

    • BishwaR's avatar
      BishwaR
      Helper V

      Thank you. But in my actual table names are repeated so when I use MAX some rows are blank.

  • v-xiaotang's avatar
    v-xiaotang
    Community Support

    Hi BishwaR 

    You can try

    Measure1 = SELECTEDVALUE('Table'[CUSTOMER NAME])
    or
    Measure2 = MAX('Table'[CUSTOMER NAME])
    or
    Measure3 = MIN('Table'[CUSTOMER NAME])

    If you want to create a new column, just use the method recommended by tomfox.
    If it is in the power query, just click the duplicate column button.

    Best Regards,

    Community Support Team _Tang

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