Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
12 | |
10 | |
6 |