The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have a table Table 1 having these below columns (A1, B1, C2, A2, B2, C2).
I need to create another table Table 2 with A, B and C as row values under the column "Type" and two other columns, 1 and 2 under which I should have the sum(A1), sum(A2) and so on.
Table 1
A1 B1 C1 A2 B2 C2
- - - - ----
- - - ------
- - --------
Table 2
Type 1 2
A Sum(all values under A1)
B
C
Mate, such tasks belong to the ETL world rather than DAX. Please use Power Query for this (as rightly suggested by the other reader).
Best
Darek
In Power Query:
Select all columns.
Unpivot them.
This should give you 2 columns (the first will have A1, B1, C1 etc).
Split the first column (by number of characters - which will be 1, as far left as possible).
This will give you 3 columns.
Select the middle column.
Pivot the column.
Rename your columns as required.
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
36 | |
14 | |
12 | |
7 | |
7 |