Forum Discussion

Darrell's avatar
Darrell
Frequent Visitor
5 years ago
Solved

Missing Data in visual Table - Week over Week

The issue is that I am trying to get Week over Week % AND the ability to use Page Filters to affect the totals.  First off, just getting the correct sales from last week is giving me problems.

 

By using these DAX codes, I am missing the "lastWeekRetailSales" for 01/11/2021, which is sales from 01/04/2021 and they do exist. 

 

lastWeekRetailSales = CALCULATE( SUM('Query_Data'[Retail_Sales]), DATEADD('Query_Data'[Start_Date],-7,DAY) )

 

lastWeekRetailSales = 
    CALCULATE (
        SUM ( 'Query_Data'[Retail_Sales] ), 
        FILTER (
            ALLSELECTED('Query_Data'),
            'Query_Data'[Start_Date]
                = MAX('Query_Data'[Start_Date]) - 7
        )
    )

 

 

 

 

This DAX code provides me with all the Sales from Last Week, but it NOT affected by the Page Filter.

 

lastWeekRetailSales2 =  
    CALCULATE (
        SUM ( 'Query_Data'[Retail_Sales] ), 
        FILTER (
            ALL('Query_Data'),
            'Query_Data'[Start_Date]
                = SELECTEDVALUE('Query_Data'[Start_Date]) - 7
        )
    )

 

 

 

What am I missing?  TIA

 

 

2 Replies

    • Darrell's avatar
      Darrell
      Frequent Visitor

      After building your Calendar, I'm in business.  Thanks Matt!