Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
I have 1 table where there is 6 columns in 1 table like below
ID | Legal | DP | IT | Ops | Comp |
ABC | InFlow | OutFlow | InFlow | InFlow | Missing |
EFG | OutFlow | Inflow | OutFlow | OutFlow | Missing |
IJK | Missing | Inflow | Missing | OutFlow | Missing |
LMN | Inflow | Inflow | Missing | OutFlow | Missing |
And i want to calculate new table like below.
ID | Type |
ABC | InFlow |
EFG | OutFlow |
IJK | Missing |
LMN | Inflow |
ABC | OutFlow |
EFG | Inflow |
IJK | Inflow |
LMN | Inflow |
ABC | InFlow |
EFG | OutFlow |
IJK | Missing |
LMN | Missing |
ABC | InFlow |
EFG | OutFlow |
IJK | OutFlow |
LMN | OutFlow |
ABC | Missing |
EFG | Missing |
IJK | Missing |
LMN | Missing |
Can i do it like this, thanks in advance
Solved! Go to Solution.
@Shams7
To create a table using DAX, here is the code. Replace Table04 with your table name.
New Table Name =
UNION(
SELECTCOLUMNS('Table04', "ID", 'Table04'[ID], "Type", 'Table04'[Legal]),
SELECTCOLUMNS('Table04', "ID", 'Table04'[ID], "Type", 'Table04'[DP]),
SELECTCOLUMNS('Table04', "ID", 'Table04'[ID], "Type", 'Table04'[IT]),
SELECTCOLUMNS('Table04', "ID", 'Table04'[ID], "Type", 'Table04'[Ops]),
SELECTCOLUMNS('Table04', "ID", 'Table04'[ID], "Type", 'Table04'[Comp])
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcnRyVtJR8sxzy8kvBzL8S0ugLLgQnOGbWVycmZeuFKsTreTq5o6mOg3dAAQLWaOnlzeSCJJGhBB2jT6+fsjKidMXCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Legal = _t, DP = _t, IT = _t, Ops = _t, Comp = _t]),
#"Added Index" = Table.AddIndexColumn(Source, "Index", 0, 1, Int64.Type),
#"Unpivoted Other Columns" = Table.RemoveColumns(Table.UnpivotOtherColumns(#"Added Index", {"Index"}, "Id", "Type"), {"Index"})
in
#"Unpivoted Other Columns"
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LeanAndPractise(Everyday) ) |
This will not feasible as all other columns except ID is calculated columns, please suggest another way
@Shams7
Use Power Query to do it using UnPivot functionality: https://www.youtube.com/watch?v=IULqUeYEnto&pp=ygUJZXhjZWxmb3J0
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
This will not feasible as all other columns except ID is calculated columns, please suggest another way
@Shams7
To create a table using DAX, here is the code. Replace Table04 with your table name.
New Table Name =
UNION(
SELECTCOLUMNS('Table04', "ID", 'Table04'[ID], "Type", 'Table04'[Legal]),
SELECTCOLUMNS('Table04', "ID", 'Table04'[ID], "Type", 'Table04'[DP]),
SELECTCOLUMNS('Table04', "ID", 'Table04'[ID], "Type", 'Table04'[IT]),
SELECTCOLUMNS('Table04', "ID", 'Table04'[ID], "Type", 'Table04'[Ops]),
SELECTCOLUMNS('Table04', "ID", 'Table04'[ID], "Type", 'Table04'[Comp])
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
86 | |
82 | |
64 | |
63 | |
56 |
User | Count |
---|---|
171 | |
112 | |
110 | |
72 | |
72 |