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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.