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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

YTD help

Hello everyone, I'm trying to create a YTD view.

 

I have dates from 2021/1/1/ to 2022/31/1 I would like to confirma if I do use the  SAMEPERIODLASTYEAR it would give me the sum or avg from the period of 2021 right? And if I use the TOTALYTD it would give the same info but considering only 2021/1/1 to 2022/31/1 right? And in the future when I do receive the data from the rest of the 2022 it would increment right?

1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

@Anonymous Ideally YES! Just make sure there are no missing values in your date table and the TOTALYTD will consider date from 2022/1/1. To understand more about it you can refer below url:-

 

https://dax.guide/totalytd/ 

 

https://dax.guide/sameperiodlastyear/ 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

3 REPLIES 3
Samarth_18
Community Champion
Community Champion

@Anonymous Ideally YES! Just make sure there are no missing values in your date table and the TOTALYTD will consider date from 2022/1/1. To understand more about it you can refer below url:-

 

https://dax.guide/totalytd/ 

 

https://dax.guide/sameperiodlastyear/ 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Anonymous
Not applicable

Thank you Samarth! I have another question, so I created the measure using the totalytd, now I would like to rank this, using rankx or another function, could you please help?

the measure is 

rat_ytd= TOTALYTD(AVERAGE(Audiencia_GE_LATAM_Raking[avg_rat_per]), Datas[Date], Datas[Date] < TODAY())
 
I just want to rank the measure using or not the ytd.
 
Just to be cleared I already have the ytd with rating, I just want to rank now
Anonymous
Not applicable

@yaolin512 do you know this?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

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.