Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi everyone
I'm trying to get an Absence count together for year to date.
One would assume that the following function would return the desired result: Absences YTD = TOTALYTD(COUNT(Absences[EmployeeId]), Absences[Date])
This does however totally seem to ingore today's date...
If, for testing purposes, I add an absence with date > TODAY in my dataset, it is being included as well.
This is very unlogical. Can someone please explain why I'm getting this behavior?
Thanks!
Solved! Go to Solution.
try this measure
ytd prev year =
CALCULATE (
TOTALYTD ( SUM ( 'Table'[Sales] ); SAMEPERIODLASTYEAR ( vDate[Date] ) );
FILTER ( vDate; vDate[Date] <= TODAY () )
)
Cheers,
Sturla
If this post helps, then please consider Accepting it as the solution. Kudos are nice too.
one option is to try is countx
COUNTX(filter(Absences,Absences[date]<today())Absences[EmployeeId])
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.
My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601
Hi @FrancisSaman ,
I am not able to reproduce your issue, could you share your report? Or, if it contains information you cannot share, create a relevant sample report and share it?
Cheers,
Sturla
@sturlaws thanks a lot for taking the time to reply!
After having searched hours and hours yesterday, I'm noticing it now working correctly. Without having changed anything...
This is not the first time that I'm noticing very stuborn behavior from PowerBI desktop when working from a duplicated file...
Anyways, it seems to work now so that brings me to my next question: I'd like to apply the YTD also to SAMEPERIODLASTYEAR, as my client wants to compare total absences for the running year with the total absences the same period last year.
I've composed this statement,
try this measure
ytd prev year =
CALCULATE (
TOTALYTD ( SUM ( 'Table'[Sales] ); SAMEPERIODLASTYEAR ( vDate[Date] ) );
FILTER ( vDate; vDate[Date] <= TODAY () )
)
Cheers,
Sturla
If this post helps, then please consider Accepting it as the solution. Kudos are nice too.
That seems to do the trick @sturlaws THANKS!
Regarding that ignoring of todays date in the YTD function: it does indeed ignore today. I added the marked section and that works now as well...
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |