Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
cobwebz
Frequent Visitor

Return total only per unique value (without creating a new table)

Good afternoon...I have seen many examples of this, but they all seem to involve creating a new table. We are using DirectQuery mode, so that option is apparently out.

 

In the example below, I simply want to get to a total enrollment result of 760, not 1,400. The 640 should not be counted twice, and that is based on the Account ID column. There is another column for "Product" (not shown due to privacy), and that is what causes multiple rows of the same Account ID to display. In this case, for example, Account ID ending in AAU has two products, but we only want to count the 640 enrollment once. And please note that this is only a snapshot of data, as we have thousands of accounts, some with several products. Users can filter down to a smaller list, but I still want to have duplicate enrollments per unique account kept out of the enrollment totals per view.

 

I tried using a CALCULATE with a SUM function, and then for the filter I used a DISTINCT along with the account ID, which I thought would only sum up enrollments per distinct ID. Rather, it totaled up everything anyway. I figured it wouldn't be so easy 😞 Or, maybe it is...but I haven't found the solution yet. Thanks!

 

powerbicomm.JPG

 

1 REPLY 1
Phil_Seamark
Microsoft Employee
Microsoft Employee

Hi @cobwebz

 

Because you are using Direct Query, perhaps use Power Query to make a copy of the table and remove duplicates.  Then you can use the new table back in Power BI Desktop to do some simple SUMs over.


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.