Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window Function false positive error #807

Closed
nayjay91 opened this issue Feb 1, 2023 · 4 comments
Closed

Window Function false positive error #807

nayjay91 opened this issue Feb 1, 2023 · 4 comments

Comments

@nayjay91
Copy link

nayjay91 commented Feb 1, 2023

Using TE3 build 3.4.8392.26581. Writing a measure with a window function and getting an error

The WINDOW function expects a table expression for argument '5'

However, in the documentation it is clear this is an optional argument and the measure runs find without it specified.

@mlonsk mlonsk transferred this issue from TabularEditor/TabularEditor Feb 1, 2023
@otykier
Copy link
Collaborator

otykier commented Feb 1, 2023

Could you share the full DAX code you use for the WINDOW function?

@nayjay91
Copy link
Author

nayjay91 commented Feb 1, 2023

VAR age = SELECTEDVALUE( 'Age_of_Forecast'[Age_of_Forecast] )
RETURN 
 CALCULATE(
     SUMX(
         WINDOW(
             0,
             abs,
             age,
             abs,
///this is the fifth argument that I leave blank
             ,
             ORDERBY(
                 'f_history'[Age_of_Forecast]
             ),
             KEEP,
             PARTITIONBY(
                 'f_history'[InventoryItemID],
                 'f_history'[CompanyDescription],
                 'f_history'[Forecast_Type],
                 'f_history'[Training_Month_End]
             )
         ),
         CALCULATE(
             SUM( 'f_history'[ForecastValue] )
             - SUM( 'f_history'[qty_sold_cleaned] )
         )
     ), ALL( 'Age_of_Forecast'[Age_of_Forecast] )
 )

@otykier
Copy link
Collaborator

otykier commented Feb 2, 2023

Thanks, we're looking into it!

@otykier
Copy link
Collaborator

otykier commented Feb 3, 2023

This is now fixed in 3.4.1. Thanks for reporting!

@otykier otykier closed this as completed Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants