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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Group by Visual table

Hello, I have the below table which I have created based upon quite a few comuns in different tables. We want it to group by ddiD to only show 1 line and sums in-nm and in-nk.

 

Capture.PNG 

 

thanks 

1 ACCEPTED SOLUTION

Hi @Anonymous,

After research, your [in-nk], [in-nm] column come from another table which relate to your 'dairy' table indirectly. You need to transfer the value to the sample or one table related directly. I create calculated columns [nk1], [nm1], [nk2], [nm2], then use SUMMARIZE to create a new table to get expected result.

1.PNG

Please download the file for more details.

https://1drv.ms/u/s!Av62M_jYbMcegRTElJ2bPluGdYGP

Best Regards,
Angelia

View solution in original post

6 REPLIES 6
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

I assume your table name as 'Table1'. You can create a new table by clicking "New Table" under Modeling on Home page, type the formula below. 

New Table =
SUMMARIZE (
    Table1,
    Table1[ddiD],
    "in-nm", SUM ( Table[in-nm] ),
    "in-nk", SUM ( Table[in-nk] )
)


For another option, you can also group by ddiD in Query Editor(button highlighted in red line) as follows, click Advanced->sum of  in-nm and in-nk group by [ddiD] column.

1.PNG

If you use option1, you will get a new table to display the result. The resouce table will be changed as the expected result if you use option2.

Best Regards,
Angelia

Anonymous
Not applicable

Hi @v-huizhn-msft, thank you for the response. Option 1 is probably better as the 2 results are in 2 different tables. Here is the code I entered and the result

 

New Table =
SUMMARIZE (
diary,
diary[ddiD],
"in-nm", SUM ( 'inv-rem'[in-nm] ),
"in-nk", SUM ( 'inv-rem'[in-nk] )
)

 

Capture.PNG 

 

As you can see it is giving the overall total not just to the sum for that DDID.

 

thanks 

Hi @Anonymous,

Could you please share your .pbix file for further analysis?

Best Regards,
Angelia

Anonymous
Not applicable

Morning @v-huizhn-msft, thanks for looking at this. File is uploaded here

 

https://www.dropbox.com/s/fzkhijotaa1eweo/Warehouse%20Calendars.pbix?dl=0 

Hi @Anonymous,

After research, your [in-nk], [in-nm] column come from another table which relate to your 'dairy' table indirectly. You need to transfer the value to the sample or one table related directly. I create calculated columns [nk1], [nm1], [nk2], [nm2], then use SUMMARIZE to create a new table to get expected result.

1.PNG

Please download the file for more details.

https://1drv.ms/u/s!Av62M_jYbMcegRTElJ2bPluGdYGP

Best Regards,
Angelia

Anonymous
Not applicable

Hi @v-huizhn-msft, thank you so much that has certainly got us closer. 1 last issue is it now displays an incorrect in-nm and in-nk becuase packs may contain more than 1 item.

 

an example of this is DDid 510880. It is showing the in-nm and in-nk as x3 the amount of the actual vaulues as there are 3 items which share the same pack so it is counting the pack 3 times.

 

The packs on this DDid which contain multiple items are 1384339P and 1384340P. We want to only count that pack weight once.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.