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.
HI I tried to do a previous year lookup but it didnt work using the tutorial herre i have a calendar table based on here
https://www.mssqltips.com/sqlservertip/4857/creating-a-date-dimension-table-in-power-bi/
And was using the caluation for the six months as a test but it came back blank I have a relation between the calendar and my date column as can be seen below.
You will see here I have values here for my date does date time affect these equations?.
Basically I want to have the ability to whatever date they selection in a year filter be it 2017 2016 it should show the year previous ie if 2017 it show the total for 2016. I made sure that i marked the table as my date table but still shows blank.
MAT (moving annual total) = CALCULATE( SUM(PBI_Sales_View[Total Price]), DATESINPERIOD('Calendar'[Date],LASTDATE('Calendar'[Date]),-6,MONTH) )
I no there is data for when i look at the year individually as below you will see 2018 has data as does 2017 so when 2018 is showing it should be showing the 2017 total but its not
When I click 2017 you will see there is indead a sales total for that year
I guess you are trying to calculate LYTD values, if so then try using This
CALCULATE(sumx(------),
FILTER(ALLSELECTED('My Date table'),
'My Date table'[year]=MAX('My Date table'[year])-1))
Sorry here is some 2017 data to proove it exsits
I guess you are trying to calculate YTD values, if so then try using DATESYTD https://msdn.microsoft.com/en-us/query-bi/dax/datesytd-function-dax
I see its showing this
=CALCULATE(SUM(InternetSales_USD[SalesAmount_USD]), DATESYTD(DateTime[DateKey]))
But how would this no to link to the previous year
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 |
---|---|
146 | |
87 | |
66 | |
52 | |
46 |
User | Count |
---|---|
215 | |
90 | |
83 | |
66 | |
58 |