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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Users online (27)