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.
These are my fields in my Data Set. I am trying to avoid filters on the report.
Order Date
Year
Month
Location
Units Sold
1. I want to extract Units Sold Month To Date of Current Year based on Order Date
2. I want to extract Units Sold Month To Date (Last Year) based on the Order Date
Want to compare Units Sold Month To Date of Current Month and Last Year Month To Date of the Same Month using DAX formula. Trying to avoid filters on the report
Example December 2018 vs December 2017
Thanks for your help
Thanks
Solved! Go to Solution.
HI, @sureshsonti
You could use SAMEPERIODLASTYEAR to create a Last Year MTD measure like below:
Current Year MTD = CALCULATE ( SUM('Table'[Units Sold]), DATESMTD ( 'Date'[Date] ) ) Last Year MTD = CALCULATE ( SUM('Table'[Units Sold]), SAMEPERIODLASTYEAR ( DATESMTD ( 'Date'[Date] ) ) )
Result:
Best Regards,
Lin
HI, @sureshsonti
You could use SAMEPERIODLASTYEAR to create a Last Year MTD measure like below:
Current Year MTD = CALCULATE ( SUM('Table'[Units Sold]), DATESMTD ( 'Date'[Date] ) ) Last Year MTD = CALCULATE ( SUM('Table'[Units Sold]), SAMEPERIODLASTYEAR ( DATESMTD ( 'Date'[Date] ) ) )
Result:
Best Regards,
Lin
Hi @v-lili6-msft Lin,
in your answer, could the cummulative sum be cut off at certain period, say a given date?
i am trying to realize some kind of graphing for running sum, however in vain.
Could you kindly help look at it , if you have time?
Appreiciate your help!
Awesome. Thanks Lin
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.
User | Count |
---|---|
107 | |
93 | |
77 | |
65 | |
53 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |