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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
roasty1980
Frequent Visitor

Summary table based off another table

Hi all

 

I have a table that has the months Jan to Dec as fields containing a number.  I would like to sum those month fields into a new table.  The new table would have 2 fields...

 

Month |  No of Days

Jan          500

Feb         560 

Mar         454

etc etc.

 

Thanks

Keith

1 ACCEPTED SOLUTION

Hi @roasty1980 ,

 

Follow steps in order in Query Editor:

 

Sample data considered:

Pragati11_0-1597765964551.png

 Then select all the 3 columns as unpivit them:

Pragati11_1-1597766112357.png

 

You will end up with following:

Pragati11_2-1597766136112.png

 

Now select your ATTRIBUTE column and then GROUP BY:

Pragati11_3-1597766195292.png

A window appears, then provide following information:

Pragati11_4-1597766244794.png

 

You end up with the required output:

Pragati11_5-1597766271686.png

 

Hope this helps.

 

Thanks,

Pragati

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

7 REPLIES 7
Pragati11
Super User
Super User

Hi @roasty1980 ,

 

You can try using following DAX to create a table with just 2 columns selected:

Tabletest = SELECTCOLUMNS(ClothingSales, "Col1", ClothingSales[Category], "Col2", ClothingSales[Date])
 
For more infornation on SELCTEDCOLUMNS, see below:
 
Thanks,
Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

parry2k
Super User
Super User

@roasty1980 not sure why you need a summary table but the following will get you the new table:

 

New Summary Table = 
SUMMARIZE ( Table, Table[Month], "No of Days", SUM ( Table[NumberofDays] ) )

 

but it will be good to know the use case of it, maybe you don't need a summary table.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thanks for the quick reply @parry2k 

 

I have a table that holds holiday data.  I trying to creating a line graph so it shows the Month on the X-axis and the total days booked on the y-axis.  Is there a way to do this without creating a new table?

 

Thanks

Keith

@roasty1980 oh yes for that you don't need a summary table, create measure:

 

Total Days = SUM ( Table[NumberofDaysCOlumn] )

 

add a line graph visual, put a month on the x-axis and Total Days measure on values and you will get a result. As a best practice, add date dimension in your model and use it for and time intelligence calculations. Once the date dimension is added, mark it as a date table on table tools.

https://perytus.com/2020/05/22/create-a-basic-date-table-in-your-data-model-for-time-intelligence-ca...

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Sorry @parry2k , I don't think I am explaining myself...

 

My "Holiday" source table has month fields

 

Jan |  Feb | Mar

10      5       15

10      5       15

10      5       15

 

I would like to have the data as follows:

 

Month | No of Days

Jan            30

Feb           15

Mar           45

 

Thanks

Hi @roasty1980 ,

 

Follow steps in order in Query Editor:

 

Sample data considered:

Pragati11_0-1597765964551.png

 Then select all the 3 columns as unpivit them:

Pragati11_1-1597766112357.png

 

You will end up with following:

Pragati11_2-1597766136112.png

 

Now select your ATTRIBUTE column and then GROUP BY:

Pragati11_3-1597766195292.png

A window appears, then provide following information:

Pragati11_4-1597766244794.png

 

You end up with the required output:

Pragati11_5-1597766271686.png

 

Hope this helps.

 

Thanks,

Pragati

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

@roasty1980 based on you the layout of your table, what @Pragati11 suggested is the way to go, unpivot your data but you don't need to use groupby step in power query, just unpivot and load the data and use measure in the visuals to group by day. Groupby is adding an extra step and can be very expensive on large datasets and that step can be avoided.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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