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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.