mhooper
mhooper

Reputation: 101

Power BI Average Measure - replace values with 0

I have a power BI measure which sort of works. I have a dataset with half hourly data (for one year) indicating either a value or 0. The measure calculates the average of each half hour across the year successfully, but it removes any period where the count is zero. Is there anyway I can add these back in. My script is below

averageValue = calculate(sum( 'datasetInput'[averageTraceForecast])/
CALCULATE (
   count ( 'datasetInput'[averageTraceForecast]),
   FILTER( ALL ( 'datasetInput'[averageTraceForecast] ),
       'datasetInput'[averageTraceForecast]<0.0

   )
))

Upvotes: 0

Views: 33

Answers (1)

Ryan
Ryan

Reputation: 2387

you can try to add +0 in the end of the measure

Upvotes: 0

Related Questions