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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Irek
Helper II
Helper II

Sum of last month by default plus sum of selected months

Hi, 

 

I'm struggling with calculation that will show on card sum of values from last month by defeault or for selected months if they are selected. I don't have a problem with last month value and also everything works fine when I choose one month. but when I'm choosing two or more months I'm getting value just for last month in selection. for example if I choose Jan and Feb I will get value from Feb and I need to see Jan value plus Feb value. 

 

my calculation: 

 

calculation =
VAR maxDate=CALCULATE(MAX('table'[date]),ALLSELECTED(table'))
RETURN
IF(MAX('tabler'[date])=maxDate,
CALCULATE(
sum('table'[value]),
FILTER(
ALLSELECTED('All Worker'),
'table'[date]=maxDate
)
)
)
 
 
thank you
Marcin
1 ACCEPTED SOLUTION

you need to use ISFILTERED. See attached.

 

 

View solution in original post

4 REPLIES 4
Irek
Helper II
Helper II

Hi @lbendlin , 

 

DateSell
01.01.202310
01.02.202312
01.03.202310
01.05.202311

 

My last month in example data is May. Goal is to see in the card last month sell by defeault when user open dashboard, for these case 11, but when user will choose different month card should include that , March 10. 

it should also sum sale when user choose few months, for example February and March should give 22. 

 

I know how to show all sum of all sale by deafult and then filtered months or how to show latest but don't know how to join both calculation in one. 

 

Thank you

Marcin 

you need to use ISFILTERED. See attached.

 

 

Thank you @lbendlin

 

Your calculation helped me a lot, but there was another isue, I had date filter (last 12 months) on whole page, that why even when I cleared the slicer card was showing "whole' sum of sales 🙂

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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