Forum Discussion
SAMEPERIODLASTYEAR with previous date filter
- Anonymous5 years ago
Hi DavidEg
My Sample:
I add YearMonth into Page filter and select 202101 and 202112.
Please try my measure:
N_TicketsOpening_LY = VAR _CurYear = YEAR(MAX(CCBI_vwTickets[OpeningDate])) Return CALCULATE(COUNT(CCBI_vwTickets[TicketId]),FILTER(ALL(CCBI_vwTickets),YEAR(CCBI_vwTickets[OpeningDate])=_CurYear-1))Result is as below.
If this reply still couldn't help you solve your problem, please show me a sample like what you are dealing with by your Onedrive for Business.
This will make it easier for me to understand your requirement.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
DavidEg - If you are using a page filter, then you will not be able to get those rows back via DAX using ALL or ALLEXCEPT, etc. Page filters pre-filter the rows available to DAX calculations.
Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008