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
pmargari
Advocate II
Advocate II

Calculate TOTALMTD depending on year filtered in the report

Hello all

I need to calculate the TOTALMTD , based on the year the user filter.

I have year as filter, and I want to calculate a measure that will show TOTALMTD depending on the year the user filter.

My measure :

CALCULATE (TOTALMTD(COUNTROWS(Table), Table [DataN], USERELATIONSHIP('Date'[Date], Table [DataN])))


So, if current year, 2023,  is selected works fine , but when I choose 2022 I get always blank  


I have tried several options , dateadd, sameperiodlastyear, PARALLELPERIOD , but I never got the correct number from the previous year.

Any tips help will be very welcome as I can’t solve this alone 
Thanks !

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @pmargari ,

Please refer to my pbix file to see if it helps you.

vpollymsft_0-1676255683965.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @pmargari ,

Please refer to my pbix file to see if it helps you.

vpollymsft_0-1676255683965.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks Community Support ,this is exactly what I need ,thanks a lot for your help !

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.