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
invision
Frequent Visitor

Relative date YTD

Dear Community,

 

I have an issue with displaying the YTD with the use of a relative date filter.

 

For example, for my sales report i want to use a relative date filter to display the sales in this month and the sales YTD.

Now if i apply a relative date filter to always have the filter set to the current month i will get the value for the sales this month but i will get a blank value for my sales YTD.

Now i have tried some formulas from different sources on the forum but these will still leave me with the result this month in the YTD.

 

I am currently using the quick measure functionality for the YTD.

 

My question is, how do i get the YTD working in combination with a relative date filter?

8 REPLIES 8
Stachu
Community Champion
Community Champion

have you tried any solutions explained here:

https://www.sqlbi.com/articles/time-intelligence-in-power-bi-desktop/

if so then probably your data model/current measures would have to be adjusted - can you share how it looks at the moment?



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

@Stachu Thanks for your response.

 

When i just select a "regular" month through a slicer for example june i get the following:

 

2018-06-14_12-22-14.jpg

 

 

Which is correct, now when i stop using the regular month as a slicer but instead use a report level filter with a relative date set to "this month". I get the following:

 

2018-06-14_12-21-30.jpg

 

As you can see the YTD is now gone where the info that is for this month is still there.

See below for the relative date filter:

 

2018-06-14_12-21-56.jpg

Stachu
Community Champion
Community Champion

I cannot replicate it, it works for me, for a very simple measure

Measure = CALCULATE(SUM('Table'[Value]),DATESYTD('Table'[Date]))

what's the syntax for your YTD measure?



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

@Stachu thanks for the quick response.

 

Your suggested measure does work, however since the relative date filter sets the date filter from 1-6-2018/30-6-2018 the YTD will only pick up from that, see image:

 

2018-06-14_13-08-14.jpg

 

How do i get the 1,961k as YTD june?

Stachu
Community Champion
Community Champion

if it ony picks up one month it means it doesn't work - it should pick up Jan-Jun, that's what DATESYTD is supposed to do
it could be that the DATESYTD should use different field for the reference - do you have a time table in your model?
https://docs.microsoft.com/en-us/power-bi/desktop-date-tables



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

@Stachu i have a date table that i'm using, i have made sure to use it for the suggested formula as well, see screenshots.

 

2018-06-14_14-47-51.jpg

 

2018-06-14_14-48-02.jpg

 

 

2018-06-14_14-48-32.jpg

 

Stachu
Community Champion
Community Champion

are there any others time related filters that may affec this? I see something on Mesec - not blank, maybe there is more?



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

@Stachu oh i'm sorry i didn't specify this, i cleared all the filters except the one i showed you and even created a new page with nothing in it and then created a new visual KPI for the data, this is blank when i put the relative date on this month.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.