Forum Discussion
Table structure/modelling issue - cannot get table structure right
- 3 years ago
HI , RichardMo
According to your description, you want to group by your column , but your columns contains the calculated columns and can not be unpivoted.
For your need, i think the best way is used dax to unpivot your table.
My test data is like this:
We can click "New Table" and enter this:
Table 2 = UNION( SELECTCOLUMNS('Table',"Person ID",[Person ID] , "City",[City] , "Category" , [Category] , "Date", [Booking date] , "Type", "Booking"),SELECTCOLUMNS('Table',"Person ID",[Person ID] , "City",[City] , "Category" , [Category] , "Date", [Session 1] , "Type", "Session1") ,SELECTCOLUMNS('Table',"Person ID",[Person ID] , "City",[City] , "Category" , [Category] , "Date", [Session 2] , "Type", "Session2") ,SELECTCOLUMNS('Table',"Person ID",[Person ID] , "City",[City] , "Category" , [Category] , "Date", [Test] , "Type", "Test") ,SELECTCOLUMNS('Table',"Person ID",[Person ID] , "City",[City] , "Category" , [Category] , "Date", [Results] , "Type", "Results"))Then we can get the result as follows and you can create some visual in your logic need:
For more information, you can refer to :
powerbi - Is it possible to unpivot in Power BI using DAX? - Stack OverflowThank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
HI , RichardMo
According to your description, you want to group by your column , but your columns contains the calculated columns and can not be unpivoted.
For your need, i think the best way is used dax to unpivot your table.
My test data is like this:
We can click "New Table" and enter this:
For more information, you can refer to :
powerbi - Is it possible to unpivot in Power BI using DAX? - Stack Overflow
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly