Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi all,
Newbie to DAX, so this might be a simple one. I'm simply using SuperStore dataset with a Date table trying to calculate JUST 2016 sales when the Order Date was in 2016. Trying to create a measure to put in a table/pie chart in which I can only get the sales for the orders placed in 2016. My work-around, I think, was using CALCULATE then the DATESBETWEEN function Jan 1 2016 - Dec 31 2016 (the relationship is from the Date table to the Orders table Order Date). When I try to use CALCULATE [TotalSales] then Filter 'Date'[Date] = 2016 or 'Orders'[Order Date] = 2016 I get blanks. I believe I've done this before but I may be wrong. Hope I'm not overcomplicating things.
Solved! Go to Solution.
Hi,
YEAR() needs to encompass the date so YEAR('Date'[Date])=2016. In the examples you posted the bracket is outside e.g. ,YEAR('Date'[Date] = 2016)
Proud to be a Super User!
i tired this equation and i got the result but when i draged this measure into visual where i want to show monthly wise i am getting the same amount till December.
Hi,
You just need to add YEAR('Date'[Date]) instead of 'Date'[Date] and you are good to go. E.g. CALCULATE([measure],ALL(Table),YEAR('Date'[Date])=2016))
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
Proud to be a Super User!
Hi ValtteriN,
Thanks for the response. I used the formula you suggested and it simply gave me the aggregate amount of sales for all years. It is not filtering for 2016. This does not change even if I exclude the ALL function nor if I change 'Date'[Date] = 2016 or 'Orders'[Order Date] = 2016. I thought there was a way to do this as you suggested but I'm not getting filtered output.
Calculations I tried:
Hi,
YEAR() needs to encompass the date so YEAR('Date'[Date])=2016. In the examples you posted the bracket is outside e.g. ,YEAR('Date'[Date] = 2016)
Proud to be a Super User!
That worked. Little things like that I'm still getting used to. Thank you so much!
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
13 | |
11 | |
10 | |
10 |