Forum Discussion

jtc900502's avatar
jtc900502
New Member
7 years ago

DAX - Help with FILTER - ALL option

I have a DAX query below (QUERY1) where I am trying to display data fomr current week and data from prior week. Prior week is defined as "Actual GI Time Intelligence Fiscal Week Key -10" and the corresponding data as "Delivery Net Weight Quantity -10" and "Item Net Weight Quantity -10". The results for the prior week comes out as null.

 

However, when I create a new query (QUERY2) with same parameter for the specifc prior week, I get data.

 

Attaching screen shots from DaxStudio of both queries with results.

 

//QUERY1

//-----------

evaluate
    (
    summarize
        (
        calculatetable
            (
            'DELIVERY ITEM'
            ,'_ACTUAL GI DATE'[Actual GI Time Intelligence Fiscal Week Key] = 667

            )

        ,'_ACTUAL GI DATE'[Actual GI Time Intelligence Fiscal Week Key]


        ,"Delivery Net Weight Quantity",[Delivery Net Weight Quantity]

        ,"Item Net Weight Quantity",[Item Net Weight Quantity]

        ,"Actual GI Time Intelligence Fiscal Week Key -10",'_ACTUAL GI DATE'[Actual GI Time Intelligence Fiscal Week Key]-10

        ,"Delivery Net Weight Quantity -10",
        calculate
            (
            [Delivery Net Weight Quantity],
            filter(ALL('_ACTUAL GI DATE'[Actual GI Time Intelligence Fiscal Week Key]), 
                    '_ACTUAL GI DATE'[Actual GI Time Intelligence Fiscal Week Key] = '_ACTUAL GI DATE'[Actual GI Time Intelligence Fiscal Week Key]-10)
            )

        ,"Item Net Weight Quantity -10", 
        calculate
            (
            [Item Net Weight Quantity],
            filter(ALL('_ACTUAL GI DATE'[Actual GI Time Intelligence Fiscal Week Key]), 
                    '_ACTUAL GI DATE'[Actual GI Time Intelligence Fiscal Week Key] = '_ACTUAL GI DATE'[Actual GI Time Intelligence Fiscal Week Key]-10)
            )

        )
    )

 

//QUERY2

//-----------

evaluate
    (
    summarize
        (
        calculatetable
            (
            'DELIVERY ITEM'
            ,'_ACTUAL GI DATE'[Actual GI Time Intelligence Fiscal Week Key] = 657
            )

        ,'_ACTUAL GI DATE'[Actual GI Time Intelligence Fiscal Week Key]

        ,"Delivery Net Weight Quantity",[Delivery Net Weight Quantity]

        ,"Item Net Weight Quantity",[Item Net Weight Quantity]

        

3 Replies