Forum Discussion
Average based on date slicer from DImtime table
- 7 years ago
I think I got this solved. I don't know if it is the perfect way, but at least from my checking it seems to work.
True Average = sum('ns InventorySnapshot'[Value])/[Days]Days = VAR a = FIRSTDATE ( Dimtime[Date] ) VAR b = CALCULATE ( MAX ( Dimtime[Date] ), ALLSELECTED ( Dimtime[Date] ) ) RETURN DATEDIFF ( a, b, DAY )+1I would think there would be a better way, but I don't know.
Hi NBOnecall
Could you share a simplified sample file here to reproduce your scenario?You can upload the .pbix file to OneDrive and post the link here. Do mask sensitive data before uploading.Please explain more about your assumed sample data and expected output.
How to Get Your Question Answered Quickly
Regards,
I think I got this solved. I don't know if it is the perfect way, but at least from my checking it seems to work.
True Average = sum('ns InventorySnapshot'[Value])/[Days]Days =
VAR a =
FIRSTDATE ( Dimtime[Date] )
VAR b =
CALCULATE ( MAX ( Dimtime[Date] ), ALLSELECTED ( Dimtime[Date] ) )
RETURN
DATEDIFF ( a, b, DAY )+1I would think there would be a better way, but I don't know.
- v-cherch-msft7 years agoMicrosoft Employee
Hi NBOnecall
Glad to hear you've solved it, please accept your reply as solution, that way, other community members will easily find the solution when they get same issue.
Regards,