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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
jaco1951
Helper III
Helper III

Problem with date filter when sum

Hi

 

I cannot get the correct sum when trying to sum a group of values where I want to collect the ones that have been updated most recently by week.

 

I have created a filter saying Date = Max(Date), so that when I select a week, I want to sum the newest data for that period.

 

balance_USD = CALCULATE(
SUMX(factTable; 'factTable'[amount_USD]);
FILTER(factTable; factTable[dataSource] = "BANK");
FILTER(cal_Reported; cal_Reported[Date] = [maxDate_Reported]) )

I have two dates for the week I am running, and it sums both... 

 

Anyone who can see what I am doing wrong?

Br Espen

1 ACCEPTED SOLUTION
jaco1951
Helper III
Helper III

Seems that I have fixed the issue, still not quite sure how... 

I changed the MAX(Date) variable, adding a ALLSELECTED filter to it:

 

maxDate_Reported = CALCULATE(

MAX(factTable[date_reported]);

FILTER(ALLSELECTED(factTable);
factTable[dataSource] = "BANK"))

View solution in original post

2 REPLIES 2
jaco1951
Helper III
Helper III

Seems that I have fixed the issue, still not quite sure how... 

I changed the MAX(Date) variable, adding a ALLSELECTED filter to it:

 

maxDate_Reported = CALCULATE(

MAX(factTable[date_reported]);

FILTER(ALLSELECTED(factTable);
factTable[dataSource] = "BANK"))

Hi @jaco1951,

 

Glad to hear that you have resolved by yourself.

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.