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

Reply
Darrell
Frequent Visitor

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
        )
    )

 

 

Darrell_0-1612979771243.png

 

 

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
        )
    )

 

 

Darrell_1-1612980032664.png

 

What am I missing?  TIA

 

 

1 ACCEPTED SOLUTION
MattAllington
Community Champion
Community Champion

ALLSELECTED by definition will not allow you to access periods that are filtered. You need to use ALL. Also, you don't seem to have a calendar table. You should always use a calendar table for time intelligence https://exceleratorbi.com.au/power-bi-calendar-tables/

 

when you use ALL(calendar[date]), it should work. 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

2 REPLIES 2
MattAllington
Community Champion
Community Champion

ALLSELECTED by definition will not allow you to access periods that are filtered. You need to use ALL. Also, you don't seem to have a calendar table. You should always use a calendar table for time intelligence https://exceleratorbi.com.au/power-bi-calendar-tables/

 

when you use ALL(calendar[date]), it should work. 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

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

 

Darrell_0-1613078558311.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.