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
RYU209
Helper III
Helper III

Transition from Row to Filter Context without CALCULATE?

I have a composite model that is giving me following error message only in Service but not Desktop.

powerqueryerror.png

 

I've done some research on this issue and there hasn't been anything conclusive. I have read that using the CALCULATE function can cause issues in service when using a Direct Query composite model, and I have some calculated columns that only use CALCULATE to transition from row to filter context. Is there an alternative function(s) that can accomplish this without using CALCULATE?

3 REPLIES 3
RYU209
Helper III
Helper III

I have an imported table on the one side of a one to many relationship with a Direct Query. I have a calculated column on the imported side that looks like this:

Total = CALCULATE(SUM(DIRECTQUERY_TABLE[Attachment Count]))

DIRECTQUERY_TABLE[Attachment Count] is a calculated column created at the data source that checks for a condition and returns 1 if the condition is fulfilled and 0 if it isn't. 
 
How can I modify this to exclude Calculate?
FreemanZ
Super User
Super User

hi @RYU209 

Yes, CALCULATE in calculated column could hide some issue and could always be replaced with iterator functions like SUMX/MINX. You can provide some sample data and let us show how it works.

Hi FreemanZ,

This is how my current calculated column looks like with CALCULATE. This calculated column is on the one side of a one-to-many relationship and is imported. 

 

RYU209_0-1673620866941.png
I want to emulate this same behavior but without using CALCULATE or any other functions that could cause problems in Direct Query. The Direct Query table is on the many side of a one-to-many relationship and is linked by Transaction.

DIRECTQUERY[Attachment Count] is a calculated column created at the data source. The data source can have duplicate "Transactions" that have an Attachment Count of 0 or 1. 

 

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.