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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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