Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
I am working with an SQL Server data source concerning insurance policies query that is almost 500 lines long and has multiple CTE's some of which Left Join to the main query to achieve results.
This is the result for one account The number for "expiring premium including endorsements", "renewal premium including endorsements and "premiumn change including endorsements" are all correct.
The report calculations are all based on the month of Expiration date. I have a request to break down what is counted by expiration date for renewed policies by bound date.
I added bound date to the CTE that is returning renewals, but when a policy has more than one bound date, two lines return and the "Expiring premium including endorsements" gets counted twice and the "premiumn change including endorsements" calculation is fooled because the initial policy was not broken by 2 bound dates.
I need to somehow create an output that allows me to accurately count the "Expiring Premium including endorsements" only once with a DAX calculation, AND interogate teh value of the bind date to determine if the amoun in the renewal premium including endorsements should or should not be included.
I have been wracking my brain concerning how I may go about this and am at an impasse.
Explore the "Group by" options in Power Query. Use "All rows" and then grab the first row of the result for each "group". Similar to what you would do in SQL with (select top 1 xxx from yyy) subqueries.
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 23 | |
| 20 | |
| 18 | |
| 14 |
| User | Count |
|---|---|
| 58 | |
| 51 | |
| 41 | |
| 30 | |
| 24 |