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.
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
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 |
---|---|
95 | |
94 | |
80 | |
71 | |
64 |
User | Count |
---|---|
115 | |
106 | |
96 | |
81 | |
72 |