Forum Discussion
Average at Different Grains
Hey All,
I used to have a table that took PowerBi 45 seconds to load and I had to move it into a semi-aggregated state.
I'm a bit stuck on how to create a new column using DAX that will only SUM and DIVIDE the data based on what's filtered (i.e what grain it's at)
Obviously in excel for a static query is might look like: SUM(SumRatings) / SUM(Count)... but I need to calculate on the grain of either ProductName, ProductSubGroupName or WeekStarting.
My new table looks like this:
1 Reply
- v-caliao-msft
Microsoft Employee
In DAX, the measure will re-calculate if you change items in your slicer. So you could create your measure by usng SUM and divide function.
https://msdn.microsoft.com/en-us/library/ee634387.aspx
https://msdn.microsoft.com/en-us/library/jj677276.aspxRegards,
Charlie Liao