Forum Discussion
need help to create table
- Anonymous5 years ago
Hi Herndon_powerbi ,
I have done it in two ways, please check:
- Use DAX:
NewTable using DAX = var _t1=SUMMARIZE('Table1',"subject","english","total_marks",SUM(Table1[english])) var _t2=SUMMARIZE('Table1',"subject","maths","total_marks",SUM(Table1[maths])) var _t3=SUMMARIZE('Table2',"subject","science","total_marks",SUM('Table2'[science])) return UNION(_t1,_t2,_t3)- In Power Query:
For Table1: select english and maths column -->click "Unpivot columns"--> select Attribute column --> click "Groupby"
For Table2: select science column -->click "Unpivot columns"--> select Attribute column --> click "Groupby"
And then click "Append Queries as new " to create a new table like this:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. - 5 years ago
Thank you so much
Hi Herndon_powerbi ,
I have done it in two ways, please check:
- Use DAX:
NewTable using DAX =
var _t1=SUMMARIZE('Table1',"subject","english","total_marks",SUM(Table1[english]))
var _t2=SUMMARIZE('Table1',"subject","maths","total_marks",SUM(Table1[maths]))
var _t3=SUMMARIZE('Table2',"subject","science","total_marks",SUM('Table2'[science]))
return UNION(_t1,_t2,_t3)
- In Power Query:
For Table1: select english and maths column -->click "Unpivot columns"--> select Attribute column --> click "Groupby"
For Table2: select science column -->click "Unpivot columns"--> select Attribute column --> click "Groupby"
And then click "Append Queries as new " to create a new table like this:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.