Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
We are now September 2018. I have data from January 2017 up to July 2018. I would like to create a measure calculating the sum of Jan 2017 up to July 2017 and another one calculating Jan 2018 up to July 2018. I do have a date tabel joined to the fact table.
Thanks for your help!
Solved! Go to Solution.
Hi @jvandyck,
I made one sample for your reference.
2017 = TOTALYTD(SUM(Table1[Sales]),SAMEPERIODLASTYEAR(Table1[YYYYMM.1]))
2018 = TOTALYTD(SUM(Table1[Sales]),Table1[YYYYMM.1])
For more details, please check the pbix as attached.
Regards,
Frank
Hi @jvandyck,
Does that make sense? If so, kindly mark my answer as a solution to close the case.
Regards,
Frank
Sample data would help. 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
That being said, you can try your luck with the time intelligence functions like SAMEPERIODLASTYEAR. Or, you might have better luck with my Time Intelligence The Hard Way Quick Measure: https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...
Simplified it boils down to this:
YYYYMM | Sales |
201701 | 10 |
201702 | 15 |
201703 | 18 |
201704 | 20 |
201705 | 90 |
201706 | 50 |
201707 | 44 |
201708 | 66 |
201709 | 21 |
201710 | 99 |
201711 | 22 |
201712 | 14 |
201801 | 19 |
201802 | 33 |
201803 | 25 |
201804 | 14 |
201805 | 16 |
201806 | 18 |
201807 | 20 |
This is the data I have. If I create the normal YTD measures, it will take the values from 201801 up to 201807, but doing this for prev year, it would take the data from 201701 up to 201709. This is not what I want, I want up to 201707.
So the YTD for this year should be 145 and prev year 247.
Hi @jvandyck,
I made one sample for your reference.
2017 = TOTALYTD(SUM(Table1[Sales]),SAMEPERIODLASTYEAR(Table1[YYYYMM.1]))
2018 = TOTALYTD(SUM(Table1[Sales]),Table1[YYYYMM.1])
For more details, please check the pbix as attached.
Regards,
Frank
Hi @jvandyck,
Does that make sense? If so, kindly mark my answer as a solution to close the case.
Regards,
Frank
I am not able to tie this back to my issue. Looks like overkill to me?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.