I got a table (fact table) that has over 10 million rows. The table contains the half-hour value of power loss. I created a measure that calculates the average of power loss and displays it line chart visual. The measure looks as follow:
Average Power = Average (Fact[Power])
The x-axis contains the hour of the day (starting from 0 to 23). Hour data is coming from time table (dimension table). The visual looks as follow:
I enabled the rectangle lasso selection. I want to select the multiple hours from the line graph and create a new measure that displays the sum of those selected hours. In other words, the new measure shows the sum of the average power of selected hours.
I created a measure as follow:
Sum selected hours Power = SUMX(Fact,[Average Power])
However, the above measure did not produce the sum of selected hours of visual. Could anyone help me where am I making the mistake?
Sorry the file size is too big and internet speed is pathetic today so could not able to upload it.
To get this to work, you just need to build out a bit of additional context in a short virtual table. We can use the same virtual table that we created in the thread about counting Lasso-selected points, but instead of COUNTROWS, we use SUMX to get the total of the points selected:
Sum of Points Selected =
VAR vTable =
ADDCOLUMNS(
VALUES( Test[Date] ),
"@valmeas", [value_measure]
)
VAR Result =
CALCULATE(
SUMX( vTable, [@valmeas] ),
ALLSELECTED( Test[Value] )
)
RETURN Result