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
I need to submit this today and have searched all over the internet but couldn't solve it.
I have two datasets one for 2021 to Present and one for 2019 to 2020.
I have created a callender table and connected all datasets to it.
Now, I have successfully created a comparison YTD for this year and last year, I want also to add YTD in 2019 which is from Jan 2019 to current month.
I also would like it to intract with the filtering, so the filter now show march 2021 as the last month but if I changed it to feb I want the YTD of 2019 calculate to feb also.
Much Approciated
Hi @RexaZii93,
If I understand correctly you want to select a date on a slicer and get the YTD value for the selection as well as the YTD for the same period last year.
Selection = May 2020
YTD = Sum of sales from January 2020 through May 2020
YTD Previous = Sum of sales from January 2019 through May 2019.
Try
SelectedSales_YTD = CALCULATE(SUM(Sales[Sales]),DATESYTD(_Calendar[Date]))
SelectedSales_PrevYTD = CALCULATE([SelectedSales_YTD],SAMEPERIODLASTYEAR(_Calendar[Date]))
It workd but I had to use a filter for the date in the data itself which has 2020 and 2019 data, can I apply a callender date to filter the data on 2019 with the same formula you wrote?
Thanks Jsaunders for you response
actually I want as the picture you did with the totals, I have the slice set for March but for some reason it shows blanks.
Also my 2019 datasets has two years in it "2020 and 2019", so can specify what year I want in the measure to fixed at 2019?
I did your forumal but showing blanks:
Hi,
Share the download link of your PBI file and also show the expected result there.
Hi Ashish
the PBI contains some sensetive data but I'll try to do a dummy PBI for you.
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 |
---|---|
86 | |
85 | |
68 | |
67 | |
63 |
User | Count |
---|---|
210 | |
118 | |
116 | |
81 | |
74 |