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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.