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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
AdeleSS
Regular Visitor

(Direct query) measures total not equal to sum of details

Hi Everyone,

 

I've searched for similar issues posted by others and tried some of the solutions in those answers but failed. And I guess it might because my data is "Direct Query" not "import"?  I would appreciate any help regarding this issue.

 

Issue description: 

PR LocalCurrency Row is calculated by item level and it can calculate correctly but the total is not what I want.

I've tried several function including following but all shows blank

PR LocalCurrency = SUMX(VALUES('Fact Shipment Detail'[Item Number]),[PR LocalCurrency ROW])
PR LocalCurrency = if(HASONEVALUE('Fact Shipment Detail'[Item Number]),[PR LocalCurrency ROW], BLANK())

 

AdeleSS_0-1707277298769.png

The data comes from company data source and I can't change any of it. Complicated relationship as below.

AdeleSS_0-1707278310034.png

 

Many Thanks!

 

 

3 REPLIES 3
Anonymous
Not applicable

Hi @AdeleSS ,

Based on your description, you seem to be experiencing common issues related to aggregation and context in DAX calculations, especially in a DirectQuery environment. You can follow the steps below to troubleshoot the problem:

1. The problem of mismatched totals may be due to the context in which the calculation is performed. Consider using CALCULATE to explicitly define the filtering context of the measure.

PR LocalCurrency =
CALCULATE (
    [PR LocalCurrency ROW],
    ALLEXCEPT ( 'Fact Shipment Detail', 'Fact Shipment Detail'[Item Number] )
)

2. Recheck your data model to ensure that the relationships are defined correctly and that no unexpected filters are being applied through those relationships. The behaviour of Power BI in handling many-to-many relationships or inactive relationships can affect the totals. Managing Relationships in Power BI Desktop:

Create and manage relationships in Power BI Desktop - Power BI | Microsoft Learn

 

How to Get Your Question Answered Quickly - Microsoft Fabric Community

If it does not help, please provide more details with your desired out put and pbix file without privacy information.

 

Best Regards,

Ada Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

sayaliredij
Solution Sage
Solution Sage

HI @AdeleSS ,

 

It would help if you can share sample data and if possible PBIX which you build with it.

You can remove sensitive information and replace it with sample size data

 

Thanks and Regards,

 

Sayali

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful!! 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




I think the type of data ( import vs direct query) matters to this issue, so I'm afraid I can't share you the data because its our company dataset using 'power bi semantic models'.

Do you have any possible methods to share that I can try by myself?

Thank you for your reply.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors