Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Get Insured Members with No Claims

Hello,

 

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:

Month_BracketMemberIDClaimed Amount($)Weight_lbs
201905xyz1000.0220
201905ijw45.12170
201905rtl0110

201906

rtl0110
201906xyz0220
201912eet147.85145

 

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.

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

Let's do it in two steps. First, calculate the total claims for each member. Then, filter and average.

 

 

AvgWeight =
VAR MemberSummary =
    SUMMARIZE (
        Table1,
        Table1[MemberID],
        "TotalClaimed", SUM ( Table1[Claimed Amount($)] ),
        "Weight", AVERAGE ( Table1[Weight_lbs] )
    )
RETURN
    AVERAGEX ( FILTER ( MemberSummary, [TotalClaimed] = 0 ), [Weight] )

 

 

This assumes all the dates are in the same year.

View solution in original post

2 REPLIES 2
AlexisOlson
Super User
Super User

Let's do it in two steps. First, calculate the total claims for each member. Then, filter and average.

 

 

AvgWeight =
VAR MemberSummary =
    SUMMARIZE (
        Table1,
        Table1[MemberID],
        "TotalClaimed", SUM ( Table1[Claimed Amount($)] ),
        "Weight", AVERAGE ( Table1[Weight_lbs] )
    )
RETURN
    AVERAGEX ( FILTER ( MemberSummary, [TotalClaimed] = 0 ), [Weight] )

 

 

This assumes all the dates are in the same year.

Anonymous
Not applicable

Wow, this is elegant and simple! 

I was trying to use SUMMARIZE but was missing the final step of filtering. Thank you so much.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.