Forum Discussion
Need Help- Total Goals Scored using DAX
I need
I have input like the above image
and want output like below image using Dax measures
Thanks in advance
Anonymous , in DAX you have use summarize and union
Try lik
SUMMARIZE(
Union(
selectcolumns(Table, "Team",Table[HomeTeam], "Goal",Table[Home Goal]),
selectcolumns(Table, "Team",Table[awayTeam], "Goal",Table[Away Goal])
),[Team] ,"Goal", sum([Goal]))https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/
3 Replies
- nvprasadSolution Sage
Hi,
You can use the "GroupBY" transformation in the query editor to get this output.
Appreciate a Kudos! 🙂
If this helps and resolves the issue, please mark it as a Solution! 🙂Regards,
N V Durga Prasad- AnonymousNot applicable
Thanks for your help but I was looking for solution using dax
- amitchandakSuper User
Anonymous , in DAX you have use summarize and union
Try lik
SUMMARIZE(
Union(
selectcolumns(Table, "Team",Table[HomeTeam], "Goal",Table[Home Goal]),
selectcolumns(Table, "Team",Table[awayTeam], "Goal",Table[Away Goal])
),[Team] ,"Goal", sum([Goal]))https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/