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
Hi all.
I'm getting used to DAX expressionswith columns, but not with tables.
I want to create new table for waterfall chart.
Here is the part of big table I have (1) and my target table (2).
-->
Could you guys help me find the best way to do this?
Appreciate.
Solved! Go to Solution.
hi. is possible that exists better solutions but i present one
TableNew2 = UNION ( SELECTCOLUMNS ( Table1, "UNIT", Table1[UNIT], "DATE", Table1[DATE], "FACTOR", "A", "WEIGHT", Table1[FACTOR A] ), SELECTCOLUMNS ( Table1, "UNIT", Table1[UNIT], "DATE", Table1[DATE], "FACTOR", "B", "WEIGHT", Table1[FACTOR B] ), SELECTCOLUMNS ( Table1, "UNIT", Table1[UNIT], "DATE", Table1[DATE], "FACTOR", "A", "WEIGHT", Table1[FACTOR C] ) )
Or
TableNew = UNION ( SUMMARIZECOLUMNS ( Table1[UNIT], Table1[DATE], Table1[FACTOR A], "FACTOR", "A" ), SUMMARIZECOLUMNS ( Table1[UNIT], Table1[DATE], Table1[FACTOR B], "FACTOR", "B" ), SUMMARIZECOLUMNS ( Table1[UNIT], Table1[DATE], Table1[FACTOR C], "FACTOR", "C" ) )
It can easily be done via the Query Editor, using Unpivot as illustrated in this video.
Actually, my columns are calculated columns, so Edit Query doesn't work here.
Any ideas?
hi. is possible that exists better solutions but i present one
TableNew2 = UNION ( SELECTCOLUMNS ( Table1, "UNIT", Table1[UNIT], "DATE", Table1[DATE], "FACTOR", "A", "WEIGHT", Table1[FACTOR A] ), SELECTCOLUMNS ( Table1, "UNIT", Table1[UNIT], "DATE", Table1[DATE], "FACTOR", "B", "WEIGHT", Table1[FACTOR B] ), SELECTCOLUMNS ( Table1, "UNIT", Table1[UNIT], "DATE", Table1[DATE], "FACTOR", "A", "WEIGHT", Table1[FACTOR C] ) )
Or
TableNew = UNION ( SUMMARIZECOLUMNS ( Table1[UNIT], Table1[DATE], Table1[FACTOR A], "FACTOR", "A" ), SUMMARIZECOLUMNS ( Table1[UNIT], Table1[DATE], Table1[FACTOR B], "FACTOR", "B" ), SUMMARIZECOLUMNS ( Table1[UNIT], Table1[DATE], Table1[FACTOR C], "FACTOR", "C" ) )
Thanks, you're awesome.
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 |
---|---|
134 | |
91 | |
89 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
72 | |
68 |