Forum Discussion
Daily Average Over Multiple Years
- 8 months ago
Hello,
Sorry again for the delay. Unfortunately these solutions did not work for what I wanted so I ended up doing it the way that would lose the metadata but kept the main numbers. So I ended up making a seperate query for each year grouped by the main categories we want, merging the queries together, then adding average columns. Not ideal but it worked. I'll just have to make separate visuals for the metadata.
Thank-you,
Tanya
Hi tl1234
First, you'll need to unpivot your data. You may want to duplicate your current table. In Power query, perform the following steps:
Select your year columns, go to transform and select 'unpivot columns'
This will give you Date, Attribute (Change column name to year), and Value
This will give you a table that will dynamically add any additional years that get added to your data as it grows.
close and apply.
Now add the following measure (Edit for your table name)
AveragePerDate =
CALCULATE(
AVERAGE(HotelData[Value]),
ALLEXCEPT(HotelData, HotelData[Date])
)This will give you the average for each date across all years
--------------------------------
I hope this helps, please give kudos and mark as solved if it does!
Connect with me on LinkedIn.
Subscribe to my YouTube channel for Fabric/Power Platform related content!