The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello Everyone! I am having an issue when it comes to using the DAX Function for TOPN and "Others".
The DAX Code is below for reference;
What I am trying to do is:
1. Have a List of Top 25 Billing Providers by Billed Amount, Allowed Amount, and Discount Percentage
2. Have a "others" subcategory to account for all other billing providers outside the top 25 list
3. The Discount should be composite and be calculated as Discount = 1 - (Allowed Amount / Billed Amount)
The issue is with the last step. Each Time I try calculating the discount I will get all of the providers outside the Top 25 Listed (pictures provided below). When I simply do the calculation Allowed Amount / Billed Amount I will get the function to group the way I wanted (Top 25 + "Others"). But for whatever reason when I do the composite it will result in retrieving everything outside the Top 25. I feel like I am so close! What am I doing wrong?
"Billing Provider Name",
CALCULATE ( (1-[Measure Discount]), KEEPFILTERS ( TopProducts ) ),
Here 1 is a constant. Whenever a product is not in the top products, this calulation retruns 1 because 1 is always there and nothing is subtracted if products are not in top products. This is what you see in your visual.
Proposed changes:
1. Change measure [Discount] to
Discount = DIVIDE (Billed Amount - Allowed Amount, Billed Amount)
2. Replace every occurence of
1-[Measure Discount]
with
[Measure Discount]
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
8 | |
8 |