Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hello,
I am running a report in Power Bi (SQL data) where I have hunders of companies. The goal is to track if the discount is properly applied in the system. The discount applies 5% for 2 or more contracts, and 10% for more than 4 contracts.
And life would be great if there were no exceptions. Two issues:
1) first one is that there are exceptions for the fleet discount eligibility. Lets say customer VIP is eligible for 5% even if they have 1 contract active and there wont be more contracts signed.
I have managed to overcome it with the formula:
if [Company ID]="454674" and [Number of contracts per Company name]=1 then "5%" else if [Number of contracts per Company name]>=4 then "10%" else if [Number of contracts per Company name]>=2 then "5%" else "0.00")
2) The second issue is that each company has individual ID, but we should sum up the number for contract for each divisions (Clothes ABC Mexico+Clothes ABC Texas; Shirts LLC+Shirts LLC Montana).
I have added the table below and in red you can see the desired column result. I would greatly appreciate your support.
| Company ID | Company name | Contract ID | Number of contracts per Company name | Discount for 2 and more contracts (5%) for more than 4 (10%) |
| 101102 | Clothes ABC Mexico | 44-44 | 1 | 5% |
| 103103 | Clothes ABC Texas | 99-99 | 1 | 5% |
| 103111 | Wool ABC | 88-88 | 1 | 0% |
| 104123 | Shirts LLC | 77-78 | 4 | 10% |
| 104123 | Shirts LLC | 77-77 | 4 | 10% |
| 104123 | Shirts LLC | 77-79 | 4 | 10% |
| 104123 | Shirts LLC | 77-71 | 4 | 10% |
| 121545 | Shirts LLC Montana | 56-87 | 2 | 10% |
| 121545 | Shirts LLC Montana | 56-89 | 2 | 10% |
| 121323 | Belts | 23-91 | 2 | 5% |
| 121323 | Belts | 23-92 | 2 | 5% |
| 454674 | VIP | 33-87 | 1 | 5% |
Hi,
This isn't really a solution as your data sounds quite variable (Customer names are always a pain!) but I'd suggest you need some additional fields within the DB or lookup tables creating within PQ (Exception Customers and Customer Groups).
I think once you have these applying a logic for which rate should be applied should be quite simple.
Hope that helps
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 5 | |
| 5 | |
| 4 |