I am looking for some help writing a DAX formula to find the average weight of members who did not have any claims during the year.
My Table has the total amount of claims for each member by month, as follows:
so in this contrived example, only member rtl had zero claims throughout 2019, so the average weight would be 110lbs.
Any idea how I would go about doing this in DAX?
I am able to write measures that filter the table, but I can't figure out how to operate on the filtered table.
Go to Solution.
Let's do it in two steps. First, calculate the total claims for each member. Then, filter and average.
VAR MemberSummary =
"TotalClaimed", SUM ( Table1[Claimed Amount($)] ),
"Weight", AVERAGE ( Table1[Weight_lbs] )
AVERAGEX ( FILTER ( MemberSummary, [TotalClaimed] = 0 ), [Weight] )
This assumes all the dates are in the same year.
View solution in original post
Wow, this is elegant and simple!
I was trying to use SUMMARIZE but was missing the final step of filtering. Thank you so much.
Submit your creative T-shirt design ideas starting March 7 through March 21, 2023.
Find out more about the March 2023 update.
Find out more about the online and in person events happening in March!