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

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply
thne123
Helper II
Helper II

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:

 

IDHourValue
135
1310
237
233
334

 

Expected results:

 

IDHourValue
1315
2310
334
1 ACCEPTED SOLUTION

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

View solution in original post

5 REPLIES 5
3CloudThomas
Super User
Super User

Can you show the DAX statement in a post?

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
 

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

3CloudThomas
Super User
Super User

create a measure:

TotalHours = SUM( 'tableName'[Value])

Then add this measure to the table

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. 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

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.