Forum Discussion
Daily average
- 8 years ago
Hey,
unfortunately calculated tables used in the data model and not as a filter or input for other functions do not update depending on changes in a slicer selection, this is by design.
I created a little Power BI file that uses this measure
average no of rows per day = var maxSelectedDate = ALLSELECTED('Table1'[Date]) return AVERAGEX(maxSelectedDate ,CALCULATE(count('Table1'[RowID])) )this measure can used on card visual, the following screenshot shows that there are an average number of rows of 2.5 for both selected days (4 from 28th of August and 1 from 1st of September.
Hope this is what you're looking for.
Regards
Hey,
unfortunately calculated tables used in the data model and not as a filter or input for other functions do not update depending on changes in a slicer selection, this is by design.
I created a little Power BI file that uses this measure
average no of rows per day =
var maxSelectedDate = ALLSELECTED('Table1'[Date])
return
AVERAGEX(maxSelectedDate
,CALCULATE(count('Table1'[RowID]))
)this measure can used on card visual, the following screenshot shows that there are an average number of rows of 2.5 for both selected days (4 from 28th of August and 1 from 1st of September.
Hope this is what you're looking for.
Regards
- chfio8 years agoRegular Visitor
Thanks TomMartens.
The PBI measure you created seems to update with the slider. I understand you're saying it isn't designed to work this way, I guess the resulting number could be wrong, but it is updating when i move the slider on the slicer.
Let me know what you think?
(in any case I'll have hundreds of days, check boxes may be difficult.)
As an aside, I'm trying to implement this for a milliseconds column too. I think im close but may open a new thread for that, if appropriate.
Best
- TomMartens8 years agoSuper User
Hey,
sorry for not being clear. Calculated tables are not designed for the direct usage in visuals, as your example using SUMMARIZE(...)
The measure I provided is explicitely designed for multiselections (the date slider selects all dates between strart and end). This selection is stored in the variable maxSelectedDate (I have to admit that a more proper name for the variable would have been "selecteddates".
This table is used as table for the iterator function AVERAGEX(...), for each date the instances of rowid are counted and then averaged.
Datesliders are the most perfect invention since sliced bread (at least almost close to that)
Regards
- chfio8 years agoRegular Visitor
Ah. Perhaps i could read more carefully! You saved the day. thanks!