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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
roncruiser
Post Patron
Post Patron

Create new Table using Measures and selected Columns from Another Table

Hello,

 

I have a table in which I've created quite a few measures.

 

I'd like to create a new table using the current table columns highlighted in green, and include the measures highlighted in yellow.
Something like the pivot function does in Power Query but done with DAX.

 

Basically pivoting columns Meas0, Meas1, Meas2, Meas3 in yellow.

Ending up with 2 new columns "Meas" and "Value".

 

New Columns...:

"Meas: column will contains the  different measures.

"Value" columns will contains the numerical values from the pivot columns.

 

New Table Columns

Set1,ID, Set2,Set3,Set4,Set5, Meas, Value

 

Current Table:

table_1.jpg

 

Need help with this one...

2 ACCEPTED SOLUTIONS
parry2k
Super User
Super User

@roncruiser try something like this:

 

 

New Table =
UNION (
SUMMARIZE ( YourTable, YourTable[Column1], YourTable[Column2],YourTable[Column3], "Meas", "Meas0", "value", [Meas0 Measure] ),
SUMMARIZE ( YourTable, YourTable[Column1], YourTable[Column2],YourTable[Column3], "Meas", "Meas1", "value", [Meas1 Measure] ),
SUMMARIZE ( YourTable, YourTable[Column1], YourTable[Column2],YourTable[Column3], "Meas", "Meas2", "value", [Meas2 Measure] ),
SUMMARIZE ( YourTable, YourTable[Column1], YourTable[Column2],YourTable[Column3], "Meas", "Meas3", "value", [Meas3 Measure] )
)

 

 

Follow us on LinkedIn

 

Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

parry2k
Super User
Super User

@roncruiser something like this then:

 

New Table =
UNION (
SUMMARIZE ( YourTable, YourTable[Column1], YourTable[Column2],YourTable[Column3], "Meas", "Meas0", "Meas1", [Meas1 Measure], "value", [Meas0 Measure] ),
SUMMARIZE ( YourTable, YourTable[Column1], YourTable[Column2],YourTable[Column3], "Meas", "Meas1", "Meas1", [Meas1 Measure], "value", [Meas1 Measure] ),
SUMMARIZE ( YourTable, YourTable[Column1], YourTable[Column2],YourTable[Column3], "Meas", "Meas2", "Meas1", [Meas1 Measure], "value", [Meas2 Measure] ),
SUMMARIZE ( YourTable, YourTable[Column1], YourTable[Column2],YourTable[Column3], "Meas", "Meas3", "Meas1", [Meas1 Measure], "value", [Meas3 Measure] )
)

 

Follow us on LinkedIn

 

Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

5 REPLIES 5
parry2k
Super User
Super User

@mahoneypat great idea, but the last reply from @roncruiser  will not be solved by any of those two options but I agree with you.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@roncruiser something like this then:

 

New Table =
UNION (
SUMMARIZE ( YourTable, YourTable[Column1], YourTable[Column2],YourTable[Column3], "Meas", "Meas0", "Meas1", [Meas1 Measure], "value", [Meas0 Measure] ),
SUMMARIZE ( YourTable, YourTable[Column1], YourTable[Column2],YourTable[Column3], "Meas", "Meas1", "Meas1", [Meas1 Measure], "value", [Meas1 Measure] ),
SUMMARIZE ( YourTable, YourTable[Column1], YourTable[Column2],YourTable[Column3], "Meas", "Meas2", "Meas1", [Meas1 Measure], "value", [Meas2 Measure] ),
SUMMARIZE ( YourTable, YourTable[Column1], YourTable[Column2],YourTable[Column3], "Meas", "Meas3", "Meas1", [Meas1 Measure], "value", [Meas3 Measure] )
)

 

Follow us on LinkedIn

 

Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

mahoneypat
Microsoft Employee
Microsoft Employee

Have you considered a matrix visual and using the Show On Rows feature for your measures?  If that doesn't work, this may be easier with a Calculation Group (using the Calculation Items pointing to your measures and used on the Rows of the matrix).

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


roncruiser
Post Patron
Post Patron

@parry2k 

I'll give a try.  AFK at the moment.
What if I want to keep one of the measures in it's own column in the newly created table?  Not pivot with the other measures.  For example "Meas1" would now be green.

 

Thank you for the timely response.  It's going to be a long night.

 

parry2k
Super User
Super User

@roncruiser try something like this:

 

 

New Table =
UNION (
SUMMARIZE ( YourTable, YourTable[Column1], YourTable[Column2],YourTable[Column3], "Meas", "Meas0", "value", [Meas0 Measure] ),
SUMMARIZE ( YourTable, YourTable[Column1], YourTable[Column2],YourTable[Column3], "Meas", "Meas1", "value", [Meas1 Measure] ),
SUMMARIZE ( YourTable, YourTable[Column1], YourTable[Column2],YourTable[Column3], "Meas", "Meas2", "value", [Meas2 Measure] ),
SUMMARIZE ( YourTable, YourTable[Column1], YourTable[Column2],YourTable[Column3], "Meas", "Meas3", "value", [Meas3 Measure] )
)

 

 

Follow us on LinkedIn

 

Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors