March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hey, I have the following problem shown in the picture.
I need to solve it with DAX language.
Are formulas useful here like
A) Generateseries
B) Addcolumns( Summarize ( ) )
How do I create this new table?
Solved! Go to Solution.
Hi @Anonymous ,
Here are the steps you can follow:
1. Create calculated table.
Table 2 =
UNION(
SELECTCOLUMNS('Table',"Year",'Table'[Year],"Employee","Cost Alex","Cost",'Table'[Cost Alex]),
SELECTCOLUMNS('Table',"Year",'Table'[Year],"Employee","Cost Ben","Cost",'Table'[Cost Ben]),
SELECTCOLUMNS('Table',"Year",'Table'[Year],"Employee","Cost Cris","Cost",'Table'[Cost Cris]),
SELECTCOLUMNS('Table',"Year",'Table'[Year],"Employee","Cost David","Cost",'Table'[Cost David]),
SELECTCOLUMNS('Table',"Year",'Table'[Year],"Employee","Cost Eric","Cost",'Table'[Cost Eric]))
2. Click [Year] to set as Sort ascending.
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @Anonymous ,
Here are the steps you can follow:
1. Create calculated table.
Table 2 =
UNION(
SELECTCOLUMNS('Table',"Year",'Table'[Year],"Employee","Cost Alex","Cost",'Table'[Cost Alex]),
SELECTCOLUMNS('Table',"Year",'Table'[Year],"Employee","Cost Ben","Cost",'Table'[Cost Ben]),
SELECTCOLUMNS('Table',"Year",'Table'[Year],"Employee","Cost Cris","Cost",'Table'[Cost Cris]),
SELECTCOLUMNS('Table',"Year",'Table'[Year],"Employee","Cost David","Cost",'Table'[Cost David]),
SELECTCOLUMNS('Table',"Year",'Table'[Year],"Employee","Cost Eric","Cost",'Table'[Cost Eric]))
2. Click [Year] to set as Sort ascending.
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @FrankAT
unfortunatelly PowerQuery is not an option, as the initial table is already an extra table which was created with DAX.
I am looking for an DAX solution.
Hi @Anonymous ,
the easiest, shortes an best way to get the desired result is to use Power Query. Unpivot the Cost columns.
With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
132 | |
90 | |
88 | |
64 | |
58 |
User | Count |
---|---|
203 | |
141 | |
107 | |
73 | |
70 |