Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
BishwaR
Helper V
Helper V

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

 

1 ACCEPTED SOLUTION
Nathaniel_C
Super User
Super User

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

Nathaniel_C_0-1653333456840.png

 







Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

8 REPLIES 8
v-xiaotang
Community Support
Community Support

Hi @BishwaR 

You can try

Measure1 = SELECTEDVALUE('Table'[CUSTOMER NAME])
or
Measure2 = MAX('Table'[CUSTOMER NAME])
or
Measure3 = MIN('Table'[CUSTOMER NAME])
vxiaotang_0-1653556565787.png

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.

vxiaotang_1-1653556746770.png

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.

Thank you so much for the help

Nathaniel_C
Super User
Super User

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

Nathaniel_C_0-1653333456840.png

 







Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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

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

tackytechtom
Super User
Super User

Hi @BishwaR ,

 

Is it this you are looking for? 🙂

tomfox_0-1653332685568.png

 

 

For this I would just create a calculated column and use this code:

DUPLICATE COL1 = 'Table'[CUSTOMER NAME]
DUPLICATE COL2 = 'Table'[SALARY]

 

Let me know if this solves your issue 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Yes I am looking for this but I do not want to use the Power Query Thanks I wanted to achieve this by using DAX

Hi @BishwaR ,

 

The calculated column code above is DAX. I guess you'd like to have a measure instead 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.