Forum Discussion
Is In YTD Filter
- 2 years ago
jfajar Is that a calculated column? Are both Date and IsInYTD columns in the same table (Calendar) ? Not sure what's going on with the DAX solution. In Power Query you could do this:
if Date.IsInYearToDate([Column1]) = true and [Column1] <= Date.EndOfMonth(Date.AddMonths(Date.From(DateTime.LocalNow()), -1)) then "YTD" else "No YTD")
- jfajar2 years agoNew Member
HI Greg_Deckler
Thank you for your update.
Just as a reference, here is a query on the back end for isinytd:
if Date.IsInYearToDate([Date])=true then "YTD" else "No YTD"Is there some modification I could make to this back end query for the above logic?
Here is the logic I used to create a column on the front end based on your suggestion:IsInYTDTrial = IF([IsInYTD] = "Yes" && 'Calendar'[Date] <= EOMONTH(TODAY(), -1),"YTD", "No")But the output of this column looks like this: - jfajar2 years agoNew Member
Greg_Deckler Thank you for your update!
I was able to find a reference to this IsInYTD Formula on my backend query. It is as follows:
if Date.IsInYearToDate([Date])=true then "YTD" else "No YTD"
Is there a change I can make to this formula to get the logic I require?
I also tried creating a custom column on the front end based on your suggestion as follows:
IsInYTDTrial = IF([IsInYTD] = "Yes" && 'Calendar'[Date] <= EOMONTH(TODAY(), -1),"YTD", "No")However, this is the output I get:- Greg_Deckler2 years agoCommunity Champion
jfajar Is that a calculated column? Are both Date and IsInYTD columns in the same table (Calendar) ? Not sure what's going on with the DAX solution. In Power Query you could do this:
if Date.IsInYearToDate([Column1]) = true and [Column1] <= Date.EndOfMonth(Date.AddMonths(Date.From(DateTime.LocalNow()), -1)) then "YTD" else "No YTD")- jfajar2 years agoNew Member
Greg_Deckler Thank you! This was exactly what I needed!