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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
cdfizz17
Frequent Visitor

Date Table Problem - Calculate Sum Missing Data Outside Filter Window

I have a Date table and a Sales table, with measures for Total Sales and 'Total Sales Offset' (Total Sales shifted by 1 month):

 

TotalSales = CALCULATE(
    SUM('Sales'[Total])
)

TotalSalesOffset = CALCULATE(
    [TotalSales],
    DATEADD('Date'[Date],-1,MONTH)
)

 

Using a date slicer to set the time window, these measures work as expected. However, the client has asked for a configurable tile slicer to replace the date filter.

 

To accomplish this, I created a third table 'Periods' which cross-filters the Date table:

 

Capture3.PNG

 

This has broken the 'Total Sales Offset' measure, see below:

 

Working as expectedWorking as expectedMissing dataMissing data

 

How can I fix this measure so that it correctly displays the data from outside the date window?

1 ACCEPTED SOLUTION

@cdfizz17 , In this case date table filter is getting removed to calculate the prior period, but of period filter is not getting removed.  

 

try if all period can help

TotalSalesOffset = CALCULATE(
[TotalSales],
DATEADD('Date'[Date],-1,MONTH), all(period)
)

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
FBergamaschi
Super User
Super User

In this measure 

TotalSales = CALCULATE(
    SUM('Sales'[Total])
)

You can remove the CALCULATE part

To answer your question I need to see the content of the table Periods and understand what you filter (full period or focus how are they determined)

 

Anyway you have setup a many to 1 connection bidirezionale that I assume is the cause of the issue but I will confirm this

Thank you for your response. The table 'Periods' is structured as below:

 

DateFilter
2024/06/01Full Period
2024/06/02Full Period
2024/06/03Full Period
2024/06/04Full Period
......
2024/12/29Full Period
2024/12/29Focus Period
2024/12/30Full Period
2024/12/30Focus Period
2024/12/31Full Period
2024/12/31Focus Period

 

'Full Period' is intended to cross-filter every date.

'Focus Period' is intended to filter a sub-set of dates, e.g. Dec-24.

@cdfizz17 , In this case date table filter is getting removed to calculate the prior period, but of period filter is not getting removed.  

 

try if all period can help

TotalSalesOffset = CALCULATE(
[TotalSales],
DATEADD('Date'[Date],-1,MONTH), all(period)
)

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you, this fixed my problem.

Period filter needed to be removed 🙂

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.