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.
Hi,
I would like to know how I can get Current Year and Last Year using a DimTime Table.
I have Filters Like Year and Period.
My DimTime table is not related to the same date each year.
Example : My starting year of 2020 is 05/01/2020 and 2021 is 03/01/2021.
I need to get the sales count and sales amount from current and last year.
I need to get YTD and PTD
I am using DirectQuery to do so.
Regards,
Frank
Solved! Go to Solution.
@Anonymous , it works great as long as you have date table,
refer to my blog
And this video: https://www.youtube.com/watch?v=cf-YNWX8Qow
I have tested both date Tables in DB and as well one in power bi.
@Anonymous , You can try measures like
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"4/30"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"4/30"))
Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA
I read that DATESYTD is not supported in DirectQuery.
@Anonymous , it works great as long as you have date table,
refer to my blog
And this video: https://www.youtube.com/watch?v=cf-YNWX8Qow
I have tested both date Tables in DB and as well one in power bi.
Thanks alot it works.
User | Count |
---|---|
74 | |
70 | |
39 | |
30 | |
28 |
User | Count |
---|---|
104 | |
95 | |
51 | |
48 | |
46 |