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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

WINDOWS function error in Power BI Services

Hi,

 

I creating a visual to track the inventory on hand per day. So I have orders, production and resell material in different days and want to see how my inventory trend by each day. I used the new function Windows in my measure Inventory On Hand and the result is showed below:

JorgeLaza63_0-1684516514973.png

However, in Power BI services I received the following error message when select the same table 

JorgeLaza63_1-1684516668201.png

I Appreciate in advance any comment to fix this problem.

Status: Needs Info
Comments
Anonymous
Not applicable

Hi @JorgeLaza63 

You mentioned that you used new function Windows in your measure Inventory On Hand , can you explain it in detail ? 

 

Best Regards,
Community Support Team _ Ailsa Tao

JorgeLaza63
Regular Visitor

Hi,

 

The formula is to obtain the inventory on hand; this has production, sales and inbound material (sourcing). Below is the example of production:

Total Production =
    CALCULATE(
        [Volume - Production by Date],
        WINDOW(0,ABS,0,REL, ALLSELECTED('Calendar'[Date]))
    )
And this is how looks Inventory On Hand
Inventory on HAND =
VAR _demand = [Total Demand]
VAR _supply = [Total Production]
VAR _currStock = [Total Stock]
VAR _inbound = [Total Inbound]
VAR result =
    _currStock + _supply - _demand + _inbound
RETURN result
 
In Power BI Desktop I added the main product, the product type and the dates (see below)
JorgeLaza63_0-1684787412029.png

In Power BI services, I can see the first and second level, but when I want to see the trend by day, the following error appears

JorgeLaza63_1-1684787535420.png

Hope this information is helpful and thanks for your time.

Regards

Jorge Lazarini