cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper I

## Calculate sum of values by grouping ID and Hours

I have a table with (among other things) colomn with ID, value and hour

I'm looking for a way to sum the value column into a single row per id and hour. So that I can make some further calculations based on this summarized value.

Example of how data is now:

 ID Hour Value 1 3 5 1 3 10 2 3 7 2 3 3 3 3 4

Expected results:

 ID Hour Value 1 3 15 2 3 10 3 3 4
1 ACCEPTED SOLUTION
Helper I

Did a referencetable in transform data view, and grouped by id, hour etc

5 REPLIES 5
Super User

Can you show the DAX statement in a post?

Helper I
Measure1 = CALCULATE(SUM(Table1[Value]), Table1[Filtercolumn1] <> BLANK(),Table1[Filtercolumn2] = "ABC")

Measure2 >20 = CALCULATECOUNT(Table1[Hour]), FILTER(Table1, [Measure1]>20))

The problem with measue2 is that the result is way lower than what I expected

Helper I

Did a referencetable in transform data view, and grouped by id, hour etc

Super User

create a measure:

TotalHours = SUM( 'tableName'[Value])

Then add this measure to the table

Helper I

My issue is then when I try to make the other measures that are based on this, they won't calculate correcty.

My next calcualtion I want to count the number of hours/(row) when the value is >20. Which I've encountered issues with when doing it this way.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

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

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors