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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
jfajar
New Member

Is In YTD Filter

Hi!

 

I have a column called "isinytd" which is a "Yes" or "No" Column.

 

When "Yes" is selected, the current output gives all the months YTD - Jan 2023 To Oct 2023

 

However, I need a new calculation which gives me all YTD Months up to the previous month. For example, since we are in Oct 2023, When yes is selected, it needs to give me all months YTD - Jan 2023 - Sept 2023

Next month in Nov 2023, the yes filter automatically gives a result of Jan 2023 - Oct 2023

 

Can I please get help on how to create this filter column? I want to use this filter on visuals so that it automatically considers only the YTD Months I need.

 

Thank you for your time and help!

 

 

1 ACCEPTED SOLUTION

@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")

 

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5
Greg_Deckler
Community Champion
Community Champion

@jfajar Use a filter of something like:

 

[isinytd] = "Yes" && [Date] <= EOMONTH(TODAY(), -1)



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@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"

jfajar_0-1697139279202.png

 

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:
jfajar_1-1697139446963.png

 

 

@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")

 

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler Thank you! This was exactly what I needed!

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:
jfajar_0-1697138774047.png

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors