Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi all!
I am working on porting over all our company reporting from Tableau to PowerBI. I have run into an issue with one of the migrations as the report does on the fly calculations against what essentialy amount to cartesian products of some large sets of data. I have worked my way through most of them and at this point am stuck on the last calc which I have spent the better half of the day beating my head against to try and figure out. The basic concept is there is a set of data for site locations (RTFN_CAMPAIGNOPPORTUNITYANALYSIS_STUDYSITES), and a set of data with lead locations (RTFN_CAMPAIGNOPPORTUNITYANALYSIS_LEADINFO). The lead location data is at a granularity below the lead, so from the perspective of my needs, that table has many duplicate values for each lead. Through options in the report, the site location data can be filtered down using a Study parameter, and the leads can be filtered down through a Date Range paramter. Finally the site locations and lead locations data sets are linked together using a both filtering relationship via a hardcoded join key of 1.
I built a measure with the below logic where I attempted to dedupe and limit the data through table variables summarizing only the columns I needed. Then build a cartesian product of the two table variables, and finally do a distance calculation on each combo of lead and site created, grabing the minimum distance in miles to use for my logic. Finally, I return a count of leads that have at least one site within 30 miles of them. Here is the measure logic:
The TOT_NOT_IN_MILE_RANGE measure is just my leads - TOT_IN_MILE_RANGE.
The result is below, and it didn't match up to the original report
To troubleshoot, I dropped my unique lead identifier in, and mocked up a measure to return the minimum mile distance for each lead. This is where things got odd in that the roll up totals didn't match what the individual lead values indicated. You can see in the below screenshot for the 18-19 age group that the totals show 5 leads didnt have a site in range and 1 did. However, when you add up the granular values, its actually 4 leads that didnt have a site in range and 2 did, with these totals being the right answer.
At this point I have exhausted my abilities to figure out why this difference exists. I have tried changing granularity of the data in the table variables, or attempting to remove filters on the outputs and am not having any success. Any help at this point would be greatly appreciated.
Thanks!
Solved! Go to Solution.
I was able to resolve the issue using the solution posted here
https://community.fabric.microsoft.com/t5/Desktop/Measure-totals-not-summing-correctly/td-p/2216682
I was able to resolve the issue using the solution posted here
https://community.fabric.microsoft.com/t5/Desktop/Measure-totals-not-summing-correctly/td-p/2216682
User | Count |
---|---|
15 | |
9 | |
8 | |
6 | |
5 |
User | Count |
---|---|
29 | |
18 | |
15 | |
7 | |
6 |