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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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