Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I want to calculate , YTD sales for 2015,2016,2017 .Can anyone tell me how to write a DAX query for that ? I have the data for gross earnings per month for each of the above year
Solved! Go to Solution.
Hey,
in this example pbix file there is an example. Have a look at the report page "YTD TimeIntelligence". Within the table "FactWithDates" there is this measure "YTD Amount"
YTD Amount = CALCULATE( TOTALYTD(SUM(FactWithDates[Amount]),'Calendar'[Date]) )
Please be aware that this measure assumes that there is a separate Calendar table, that is related to the fact table. If you don't have a separate calendar table you should consider to create one, as most of the DAX Time Intelligence functions in DAX just work if there is no missing date value in the column used as parameter.
This link also provides additional examples regarding time relevant calculations
http://www.daxpatterns.com/time-patterns/
Hope this gets you started
Regards
Hey,
in this example pbix file there is an example. Have a look at the report page "YTD TimeIntelligence". Within the table "FactWithDates" there is this measure "YTD Amount"
YTD Amount = CALCULATE( TOTALYTD(SUM(FactWithDates[Amount]),'Calendar'[Date]) )
Please be aware that this measure assumes that there is a separate Calendar table, that is related to the fact table. If you don't have a separate calendar table you should consider to create one, as most of the DAX Time Intelligence functions in DAX just work if there is no missing date value in the column used as parameter.
This link also provides additional examples regarding time relevant calculations
http://www.daxpatterns.com/time-patterns/
Hope this gets you started
Regards
Thanks ,that was helpful .Got my desired result 🙂
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
85 | |
66 | |
51 | |
45 |
User | Count |
---|---|
216 | |
89 | |
82 | |
66 | |
57 |