Forum Discussion
SanchoPL
1 year agoNew Member
Rows headers into columns on the visualisation
Hi, I have an issue which I try to solve and i am wondering if its possible. I have a table with data (consumption) which collect data for various meters, each specific meter is a single column....
- 1 year ago
Hello SanchoPL,
Can you please try this DAX approach to transform the data dynamically:
MeterConsumptionTable = VAR UnpivotedTable = UNION( SELECTCOLUMNS( 'DataTable', "Meter", "Meter 1", "Date", 'DataTable'[Data], "Consumption", 'DataTable'[Meter 1] ), SELECTCOLUMNS( 'DataTable', "Meter", "Meter 2", "Date", 'DataTable'[Data], "Consumption", 'DataTable'[Meter 2] ), SELECTCOLUMNS( 'DataTable', "Meter", "Meter 3", "Date", 'DataTable'[Data], "Consumption", 'DataTable'[Meter 3] ), SELECTCOLUMNS( 'DataTable', "Meter", "Meter 4", "Date", 'DataTable'[Data], "Consumption", 'DataTable'[Meter 4] ), SELECTCOLUMNS( 'DataTable', "Meter", "Meter 5", "Date", 'DataTable'[Data], "Consumption", 'DataTable'[Meter 5] ), SELECTCOLUMNS( 'DataTable', "Meter", "Meter 6", "Date", 'DataTable'[Data], "Consumption", 'DataTable'[Meter 6] ), SELECTCOLUMNS( 'DataTable', "Meter", "Meter 7", "Date", 'DataTable'[Data], "Consumption", 'DataTable'[Meter 7] ) ) RETURN UnpivotedTable
SanchoPL
1 year agoNew Member
You've made my day! Its working 🙂
Thanks a lot for quick answer, I woudn't do it myself as I'm new in Power BI environment.
Anonymous
1 year agoNot applicable
Hi SanchoPL ,
Glad to hear you may have found a solution! If you're sure the issue has been resolved, could you mark this post as resolved? That way, others with similar issues can more easily find a solution and the community can see that the issue has been resolved.
Thanks, and feel free to reach out if you need further help!