Forum Discussion
Filter data in the report period
Hello!
I'm starting at power bi and I'm certain difficulty to generate the following report:
I need the sum of a specific field values (in seconds) of a given id (id field value 1) but requires that the report a month to appear.
the table is so (required fields):
date (contains dates)
actiontime (contains the values that must be added in seconds)
id (contains numerical values from 1 to 4)
Summarizing need to filter the records that have id = 1 and add the values of actiontime field. In the detailed report that is displayed by period month / day and the sum is displayed in hours.
If anyone knows how to help me.
Thank you!
6 Replies
- KGrice
Memorable Member
Hi angelobrg. If I understand correctly, you want to sum the actiontime field, which is recorded in seconds, and then convert that to hours. To do that, you can create a new measure that adds the seconds and divides the total by 3600 (divide seconds by 60 to get minutes, then by 60 again to get hours). Format in the Modeling tab to show however many decimal places you prefer, and give it a name that makes sense to you.
actiontime in hours = SUM(TableName[actiontime]) / 3600
You also want to calculate that specifically for id=1. You can create a second measure that builds on the first:
actiontime in hours ID1 = CALCULATE([actiontime in hours], TableName[id]=1)
You'll also need to format that measure, as the formatting is not inherited from previous measures.
This measure will also take into account the row context of any way you divide up your data, e.g., by month in a table.