Forum Discussion
YTD average on line chart
Hi!
New member here :-)
I have a line chart showing to water usage (in m3) in a building for the last 8 days. The data comes from a Power BI Dataflow every morning with readings from the previous day. One reading every hour; 24 readings per day.
I would like, on the same line chart, a line that shows the average water compsumption YTD, so that I can compare.
I assume I need to make som measures, but I need a hint to get me started? Anyone? :-)
7 Replies
- AnonymousNot applicable
Hi MRN8840 ,
As you said, yes, you need a measure to calcualte the avg value of YTD, then put it as value, then I think that's what you want.
I assume that you only have 1 year data, then the YTD measure can be:
YTD = sum(your_water_usage) / countrows(value(your_date_column))
please try.
Aiolos Zhao
- MRN8840
Helper I
Hi Anonymous
Thanks for the reply!
I forgot to mention something rather important! The building actually has three watermeters, which I sum together in the visualisation:
I assume that I somehow need to add these three together also? Maybe in another measure or in the same?
- AnonymousNot applicable
Hi MRN8840 ,
I think that's depands on what you want, if you want to sum 3 together, then you can do that in a measure I think.
But according to your screenshot, it seems that you use filter to get your 3 watermeters type,
if your watermeter data is in one column, but you need 3 of watermeters type, then you can use filter to do it.
if what I understand is wrong, then you can try to sum the 3 watermeters column together in one measure.
You can try it.
Aiolos Zhao