Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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?
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?
@Stachu Thanks for your response.
When i just select a "regular" month through a slicer for example june i get the following:
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:
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:
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?
@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:
How do i get the 1,961k as YTD june?
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
@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.
are there any others time related filters that may affec this? I see something on Mesec - not blank, maybe there is more?
@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.
User | Count |
---|---|
100 | |
87 | |
81 | |
76 | |
71 |
User | Count |
---|---|
112 | |
105 | |
96 | |
74 | |
66 |