- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Groupby in a calculated column
Hello All,
I am working in composite model in power bi. Used summarize function to create a import table from direct query table .
How will i group emp id and month to get the hours in one single line item insated of 4.
Note: Group by in Power query is not possible as this is a sumarrised table from direct query
Thank you
KIndly advise
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @unknown_anony ,
Thanks for @Sergii24 reply.
Here some steps that I want to share, you can check them if they suitable for your requirement.
Here is my test data:
Create a new table
Table 2 =
SUMMARIZE(
'Table',
'Table'[Emp.ID],
'Table'[SAP Month],
"SUM", CALCULATE(
SUM('Table'[Record hours]),
ALLEXCEPT(
'Table',
'Table'[Emp.ID],
'Table'[SAP Month]
)
)
)
Final output
Best regards,
Albert He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @unknown_anony ,
Thanks for @Sergii24 reply.
Here some steps that I want to share, you can check them if they suitable for your requirement.
Here is my test data:
Create a new table
Table 2 =
SUMMARIZE(
'Table',
'Table'[Emp.ID],
'Table'[SAP Month],
"SUM", CALCULATE(
SUM('Table'[Record hours]),
ALLEXCEPT(
'Table',
'Table'[Emp.ID],
'Table'[SAP Month]
)
)
)
Final output
Best regards,
Albert He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @unknown_anony , could you share with us your DAX code for creating this table? Summrize function should group the table by columns you specify and then perform sum operation over Recorded Hours.
The result from you screehshot seems to be achieved by a following expression:
SUMMARIZE(
_DirectQueryTable,
[Emp.ID],
[SAP Month],
[Recorder Hours]
)
If it's so, your result is correct as PowerBI giving you unique combination of 3 of them for each row.
In order to sum Recorder Hours you need to specify it in Name and Expression parameters of Summarize()
So your code should be similar to this:
SUMMARIZE(
_DirectQueryTable,
[Emp.ID],
[SAP Month],
"@RecordedHours", SUM( _DirectQueryTable[Recorded Hours] )
)
I hope it helps! 🙂

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
08-18-2024 09:59 PM | |||
08-18-2024 10:40 AM | |||
08-05-2024 11:08 PM | |||
09-30-2022 04:24 AM | |||
09-01-2024 11:51 PM |
User | Count |
---|---|
121 | |
104 | |
85 | |
52 | |
46 |