Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi Everyone,
What formula i can use to get same amount of orders last year, month and day? for example last year 06.03.2023 amount.
My current formula is this but this but it doesn't work correctly as it shows me LYTD full month! and not up to 06.03.2023
SAMEPERIODLASTYEAR combined with an EDATE(xxx,-12) limiter is the safest bet.
Thank you for the idea! would be able please to help me put this in my formula? i would really apprecaite your support.
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information or anything not related to the issue or question.
If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
Unfortunately i cannot provide sample data as it's senstive, do you think you could tell me approx where to put this in my formula to get LYTD specifc month amounts?
Sorry, I cannot assist without meaningful sample data. I hope someone else can help you further.
Hi @FR14 ,
Based on your description, here is the dummy data I created.
OrderLine:
Dates:
Please try code as below.
LY YTD Bookings =
VAR _MaxDate = MAX(Dates[Date])
VAR _PreviousYear = YEAR(_MaxDate) - 1
RETURN
CALCULATE(
SUM(OrderLine[Booking USD]),
YEAR(OrderLine[Open_Date]) = _PreviousYear,
MONTH(OrderLine[Open_Date]) <= MONTH(_MaxDate),
DAY(OrderLine[Open_Date]) <= DAY(_MaxDate)
)
Or you can also consider using the following code.
Previous YTD =
CALCULATE (
SUM ( 'OrderLine'[Booking USD] ),
DATESYTD ( DATEADD ( 'OrderLine'[Open_Date], -1, YEAR ) )
)
Result is as below.
Is this the result you expect?
Please correct me if I misunderstood your needs.
Best Regards,
Yulia Yan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Everything works okay for the month total but for complete LYTD total it doesn't add up correct and total is wrong:( do you know how we can solve this?
Hi @FR14 ,
I am not sure if I understood your question correctly.
Can you share sample data and the results you are hoping for? Show it as a screenshot or excel. Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Best Regards,
Yulia Yan
Your first method works correctly to have exact value for LYTD March, Jan & Feb but when i check the total LYTD Jan,Feb & March the total doesn't sum up correctly.
Thank you so much for the efforts to support! i tried first method but when i leave the filter on default (all months) it doesn't work correctly. I want this to be able to show LYTD totals and then when i select March it only shows March values. Do you think there is anyway to do this?
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
User | Count |
---|---|
70 | |
35 | |
21 | |
18 | |
15 |
User | Count |
---|---|
128 | |
29 | |
27 | |
24 | |
22 |