cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mypants Frequent Visitor
Frequent Visitor

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:

 

Capture.PNG

1 REPLY 1
Moderator v-caliao-msft
Moderator

Re: Average at Different Grains

@mypants,

 

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.aspx

 

Regards,

Charlie Liao

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)