The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello everyone,
I am trying to create DAX for YTD with Filter as shown below. My date range starts from 01/01/2012 to the current date. When I filter on any of the months then the YTD with Filter should calculate the sales till that month for example as shown below in the 1st table, I have filtered on month '06/1/2019' and I got YTD for the year 2019 till June as '270'. I tried using TOTALYTD but that is giving me just the '06/1/2019' sales rather than from 01/01/2019 to 06/01/2019. I need my YTD calculation to give me the sum of sales from Jan to June as '270' as shown in below 2nd table
Date | Sales | YTD with Filter |
7/1/2018 | 20 | 20 |
8/1/2018 | 40 | 60 |
9/1/2018 | 60 | 120 |
10/1/2018 | 70 | 190 |
11/1/2018 | 80 | 270 |
12/1/2018 | 90 | 360 |
1/1/2019 | 20 | 20 |
2/1/2019 | 30 | 50 |
3/1/2019 | 40 | 90 |
4/1/2019 | 50 | 140 |
5/1/2019 | 60 | 200 |
6/1/2019 | 70 | 270 |
7/1/2019 | 80 | |
8/1/2019 | 90 | |
9/1/2019 | 100 | |
10/1/2019 | 110 |
Date | Sales | TOTALYTD | YTD with Filter |
6/1/2019 | 70 | 70 | 270 |
Solved! Go to Solution.
Hi @Anonymous ,
TOTALYTD should indeed give 270 as you say. Can you share the formula you used for TOTALYTD?
Could you also share a sample Power BI file via DropBox, One Drive or another similar tool?
Regards
LC
Hi @Anonymous ,
TOTALYTD should indeed give 270 as you say. Can you share the formula you used for TOTALYTD?
Could you also share a sample Power BI file via DropBox, One Drive or another similar tool?
Regards
LC
User | Count |
---|---|
11 | |
9 | |
6 | |
6 | |
5 |
User | Count |
---|---|
23 | |
14 | |
14 | |
9 | |
7 |