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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
harpreetsingh08
Regular Visitor

Summarize data into new table

Hello,

I have the following data 

I am trying to create a new table that groups the "Department" column and sums "No of device" 

filtered on "Ticket Status" (Open) and "Attribute" containing the keyword "Laptop". 

 

IDYearDepartmentTicket StatusAttributesNo of device
12022FinanceOpenLaptop keyboard issue2
22022FinanceOpenDocking Station 2
32022HRClosedLaptop Disk Issue1
42022ITOpenDocking Station2
52022ITOpenLaptop Webcam Issue9
      
2 ACCEPTED SOLUTIONS
tackytechtom
Super User
Super User

Hi @harpreetsingh08 ,

 

Here a solution in DAX:

tomfox_0-1656019990323.png

 

Note, I called the table you pasted above 'TableToBeGrouped'

TableGroupedNew = 
SUMMARIZE (
    FILTER ( 
        'TableToBeGrouped', 
        [Ticket Status] = "Open" && CONTAINSSTRING ( TableToBeGrouped[Attributes], "Laptop" )
    ),
    [Department],
    "SumOfTickets", SUM ( 'TableToBeGrouped'[No of device] )
)

 

Let me know if this helps or if you need the solution in Power Query 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

View solution in original post

tackytechtom
Super User
Super User

Hi @harpreetsingh08 

 

Awesome that I could help! Do not forget to mark the answer as a solution 🙂

 

You cannot sum over strings. You need to change the column to number:

tomfox_0-1656053275520.png

 

Hope this helps!


/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

View solution in original post

3 REPLIES 3
tackytechtom
Super User
Super User

Hi @harpreetsingh08 

 

Awesome that I could help! Do not forget to mark the answer as a solution 🙂

 

You cannot sum over strings. You need to change the column to number:

tomfox_0-1656053275520.png

 

Hope this helps!


/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

tackytechtom
Super User
Super User

Hi @harpreetsingh08 ,

 

Here a solution in DAX:

tomfox_0-1656019990323.png

 

Note, I called the table you pasted above 'TableToBeGrouped'

TableGroupedNew = 
SUMMARIZE (
    FILTER ( 
        'TableToBeGrouped', 
        [Ticket Status] = "Open" && CONTAINSSTRING ( TableToBeGrouped[Attributes], "Laptop" )
    ),
    [Department],
    "SumOfTickets", SUM ( 'TableToBeGrouped'[No of device] )
)

 

Let me know if this helps or if you need the solution in Power Query 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Thanks, it solved the problem!

There is one more fix I need help with, the "No of device" is a string.

How to sum a string data type?

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.