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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
gsmith_eqd
Frequent Visitor

Internal Error - complex expression must be simplified?

I have created this measure which selects either qtyshorttoship, qtyshortofsold, or buffer, depending on whether each value is greater than 0. Then it takes that value and subtracts from it 3 measures which represent the sum of items in stock or in progress.

 

VAR __input = IF([QtyShortToShip] > 0, [QtyShortToShip], IF([QtyShortOfSold] > 0, [QtyShortOfSold], [Buffer]))
VAR __result = __input - [WIR Stock] - [ASY In Progress] - [ASY Stock]
RETURN

IF(__result > 0, __result, BLANK())

 

However, the visual cannot be displayed. I'm thrown an error message: "Internal error: an expression services limit has been reached. Please look for potentially complex expressions in your query, and try to simplify them.. The exception was raised by the IDbCommand interface."

 

How should I approach simplifying this expression?

2 REPLIES 2
m3tr01d
Continued Contributor
Continued Contributor

Hi

Unfortunately it is very difficult to help you if you don't give us the definition of all the measures
[QtyShortToShip]
[QtyShortOfSold]
[Buffer]
[WIR Stock]
[ASY In Progress]
[ASY Stock]

Then, we might be able to help you.

I can provide that, but since posting this I made another realization: the measure fails to load just this portion alone:

 

IF([QtyShortToShip] > 0, [QtyShortToShip], IF([QtyShortOfSold] > 0, [QtyShortOfSold], [Buffer]))

 

Maybe that gives another clue. Here are the definitions for those measures and the measures that are used within them:

 

QtyShortToShip = SUM(ProductionItems[QtyShipping]) - [Finished Stock]

QtyShortOfSold = [Sold] - [Finished Stock]

Finished Stock = CALCULATE(SUM(InventoryMaster[Qty]), LocationMaster[Code] IN {"FIN1", "FIN1C", "FIN1I"})

Buffer = SUM(ProductionItems[BufferQty])

Sold = SUM(DocumentLine[QtyToShip])

WIR Stock = CALCULATE(SUM(InventoryMaster[Qty]), ItemMaster[Stage] = "WIR", LocationMaster[LocationType] = 2)

ASY Stock = CALCULATE(SUM(InventoryMaster[Qty]), ItemMaster[Stage] = "ASY", LocationMaster[LocationType] = 2)

ASY In Progress = CALCULATE(SUM(ProductionRun[QtyAssigned]), ProductionRun[CloseDate] = BLANK(), ProductionRun[ProductionStage] = "ASY")

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