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
Invisibleman
Helper II
Helper II

REQ help to get the value of the sum of only the last selected year and month

Dear all,

 

I'm sorry to bother you again. But I am trying to get some listing by selecting the date and the year. Which is no problem and it's working. Further do I have a selection where I can get the result in the EUR or USD, also this is no problem.

 

The problem I have, is that when I made the year and month selection, beside the listing, I also want only the value on the year & month that I selected. Also then with the selection of EUR or USD. And this I don't get to work. When I make the selections, this will then adding up all the selected periods, and not only the last selected year & month. Which I do have also a measure for and those also are workin. Only the sum formula to get this to work I can't seem to get. 

 

The result of the last value I will need to display but also need to use in other calculation to add up where needed.

 

If anybody could help me, that would be very appriciated.

 

This is the test pbix I created 

This is the test excel file I am using 

 

Thanks in advance,

 

With regards,

Hans

1 ACCEPTED SOLUTION

Hello ShrinArshadnia,

 

Thanks for the reply I did try and both didn't work. For teh KeepFilter I didn't notice the difference  with the regular Filters. The selectedvalue, did work partly with the year, but only when I have selected 1 year, as when selecting multiple years, the vale was showing (Blank) and I do need the option to select multiple years

 

But I think I found what I need; 

BestForYEAR3 = CALCULATE(sumx(TestSheet,[-SwitchBackOrderEURUSD]),FILTER(TestSheet,TestSheet[Year] = max(mapCalendar[Year]) && TestSheet[Month] = max(mapCalendar[Month])))
 
This also works with the measure -SwitchBackOrderEURUSD.
 
Anyway thank you very much that you did make the time to reply and to help me to find the solution.
 
Regards,
Hans

View solution in original post

2 REPLIES 2
ShirinArshadnia
Helper II
Helper II

Hi @Invisibleman 

try to use keepfilters or selectedvalue in your dax query 

for further help please  visit the link below:

https://learn.microsoft.com/en-us/dax/filter-functions-dax

 

 

Hello ShrinArshadnia,

 

Thanks for the reply I did try and both didn't work. For teh KeepFilter I didn't notice the difference  with the regular Filters. The selectedvalue, did work partly with the year, but only when I have selected 1 year, as when selecting multiple years, the vale was showing (Blank) and I do need the option to select multiple years

 

But I think I found what I need; 

BestForYEAR3 = CALCULATE(sumx(TestSheet,[-SwitchBackOrderEURUSD]),FILTER(TestSheet,TestSheet[Year] = max(mapCalendar[Year]) && TestSheet[Month] = max(mapCalendar[Month])))
 
This also works with the measure -SwitchBackOrderEURUSD.
 
Anyway thank you very much that you did make the time to reply and to help me to find the solution.
 
Regards,
Hans

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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