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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
admin11
Memorable Member
Memorable Member

How to replace my YTD expression from old to new ?

Hi All

 

I have many table in many tab already using below expression for YTD :-

 

Sales YTD =
var _max = date(year(today())-0,month(today()),day(today()))
return
TOTALYTD(('SALES'[SALES_]),dateadd('DATE'[Date],-0,year),'DATE'[Date]<=_max)

Since @dvl_ctaul share with me a new YTD expression , which is flexible and dynamic :-

 

YTD_FLEX = CALCULATE (
[SALES_],
DATESYTD('DATE'[Date])
)
 
I don't want to create new table start from zero , it is very time consumming , since my existing table Sales YTD have link with colorful condition look like below :-
 
admin11_0-1642456643112.png

 

May i know it there a better appraoch ?

 

Paul

1 ACCEPTED SOLUTION

@admin11 Paul,

 

Both are same at the end.

If it was my report, I would use the Option 1.

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

View solution in original post

4 REPLIES 4
admin11
Memorable Member
Memorable Member

Hi @VahidDM 

Thank you for sharing . 

i have 2 option :-

Option 1 :- To modify Sales YTD expression to below :-

YTD_FLEX = CALCULATE (
[SALES_],
DATESYTD('DATE'[Date])
)
Option 2 is to create a new YTD expression . and modify the Sales Vari % expression.
 
May i know which is best practice ?
 
Paul

@admin11 Paul,

 

Both are same at the end.

If it was my report, I would use the Option 1.

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

@VahidDM 

Since you are so experience , i belife your advise is correct . I will follow your foot step. 

Thank

VahidDM
Super User
Super User

Hi @admin11 

 

Your question is not clear for me! can you add more details?

 

BTW, You can update the SALES VARI% and use YTD_FLEX rather than SALES YTD, then just keep YTD_FLEX and SALES VARI% in the table visual. If your conditional formatting is based on the SALES VARI% value, it won't affect by this change.

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

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.

Top Solution Authors
Top Kudoed Authors