Forum Discussion
vbiqvitovs
9 years agoFrequent Visitor
SUM of Distinct Rows
I'm new to PowerBI and I can't seem to wrap my head around this calculation. My end goal is to look at the average duration of SQL Job executions over the past 7 days and compare this value to the mo...
- 9 years ago
Should be something along the lines of:
Measure = CALCULATE(AVERAGE([Run Duration]),FILTER(Table,[Run Date]>TODAY()-7))
Greg_Deckler
9 years agoCommunity Champion
Should be something along the lines of:
Measure = CALCULATE(AVERAGE([Run Duration]),FILTER(Table,[Run Date]>TODAY()-7))
- vbiqvitovs9 years agoFrequent Visitor
At first glance, this doesn't appear to address the one-to-many relationship between the SQL Job and underlying steps.
It's a good first step, I'll see if I can use this.
- Greg_Deckler9 years agoCommunity Champion
You would put SQL Job and this Measure in a table. If you have the relationship built between them, then the context should be correct and you will get the right answer.
- vbiqvitovs9 years agoFrequent Visitor
The issue with this is that the duration specified in the data table is the duration of each step, instead of the higher-level job. This would only be a working solution if I wanted to get the average duration of the sub-steps, and not the job itself. I first need to sum all steps based on their association to the SQL job.