Forum Discussion
Dynamic Groups based on Dollar Amount
Hi,
This is a follow up question to a previous question I've asked (that has already been answered).
I have an excel table 'Claim Data' I'm bringing in to Power BI. The table has medical claim data. The two fields that apply to my question here are [Plan Payment Amount] and [Claim Serial Number]. Each [Claim Serial Number] can populate numerous times in this table (meaning a customer could have gone to the same doctor for the same cold multiple times and it would have been logged with the same [Claim Serial Number] because it was for the same issue). Each instance (row) of the [Claim Serial Number] is also populated with a [Plan Payment Amunt]. For example:
Claim Serial Number Plan Payment Amount
0077 $1.00
0077 $3.00
0077 $10.00
0050 $150.00
0077 $10.00
0030 $25.00
My current question is. How can I go about creating a dynamic [Plan Payment Amount] group? I know Power BI has the option/ability to create a Group based on dollar amounts...but this is limited in that the user either has to specify how many Groups to create (and this can create strange dollar amount buckets)...or the user has to manually create each bucket and then manually drag each dollar amount/instance in to each group.
There are two issues with both of these methods for my situation. For one, the groups I need to create are as follows:
Group A: $0 to $499
Group B: $500 to $999
Group C: $1000 to $2499
Group 😧 $2500 to $4999
Group E: $5000 to $9999
Group F: $10000 to $14999
Group G: $15000 to $19999
Group H: $20000 to $39999
Group I: $40000+
So, I need to create 9 groups, but because each group can be a different size, the "Number of Groups" useability won't work.
Also, for my situation, each [Claim Serial Number] can (and often does) populate more than once (as the example above represents). I'd like to first sum together each [Claim Serial Number] accordingly first...and then have these totals Grouped in to the dynamic groups that I'm trying to create.
This is going to be a template as well...so the excel sheet I'm bringing in will be constantly updated. Here is a photo of my current relationships.
2 Replies
- amitchandak
Super User
Anonymous , refer if these can help
https://www.daxpatterns.com/dynamic-segmentation/
https://www.daxpatterns.com/static-segmentation/
https://www.poweredsolutions.co/2020/01/11/dax-vs-power-query-static-segmentation-in-power-bi-dax-power-query/
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization- AnonymousNot applicable
Hi Amitchandak,
I found this link useful: https://www.burningsuit.co.uk/blog/2018/06/dax-how-to-group-measures-into-numeric-ranges/
I've created my Range Table as suggested in the link above.
Here is a screen shot of the Table I created. I also attached a screen shot of my relationships showing that I do not have any relations built as directed:
I'm now at the point where I need to create my measure(s). I'd like to build it out so that the [Plan Payment Amount] for each [Claim Serial Number] are summed together. This new value is what I'd like to have bucketed in to the Claim Ranges I've built in the new table. This is because (as I stated above in the original post)...the same [Claim Serial Number] could populate multiple times. I need each [Claim Serial Number]'s [Plan Payment Amount] to be summed together...and have this new summed value be the value that is actually being bucketed.
Thank you for the help so far. I think I am close, just having trouble writing this new neasure. Can you please help? Please let me know if you need anymore detail from me.
Thank you,
Andrew