Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
somya_jain
New Member

Need Help- Total Goals Scored using DAX

I need 

WhatsApp Image 2020-07-24 at 2.37.19 PM.jpeg

I have input like the above image

and want output like below image using Dax measures

WhatsApp Image 2020-07-24 at 2.37.19 PM (1).jpeg

 

@Anonymous @mim @dax @Meak 

 

Thanks in advance

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@somya_jain , 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/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@somya_jain , 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/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
nvprasad
Solution Sage
Solution 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

Did I answer your question? Mark my post as a solution! Appreciate your Kudos.
Follow me on LinkedIn.

Thanks for your help but I was looking for solution using dax

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors