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.
I can't seem to get the previous day sales DAX to work:
Solved! Go to Solution.
@Anonymous - when troubleshooting DAX errors, look for where the red squiggly underline begins - you're missing a close bracket near that point after the SUM function, see in bold red below:
Previous Day Sales = CALCULATE(SUM(AssaySales[Extended Sales PMAR Amount] ), PREVIOUSDAY('AssaySales'[Ship Date (MM/DD/YYYY)] ) )
Also, very IMPORTANT, you need a DimDate table for the PreviousDay function to work properly: https://excelwithallison.blogspot.com/2020/04/dimdate-what-why-and-how.html
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Hi,
You missed to close sum function, use below one--
Previous Day Sales = CALCULATE(SUM(AssaySales[Extended Sales PMAR Amount], PREVIOUSDAY('AssaySales'[Ship Date (MM/DD/YYYY)])))
and its better if you create seprate date table.
Let me know, if you still face chellenge.
Thanks
Naveen Mechu
@AllisonKennedy here's the DAX with the DimDate suggestion.
@Anonymous what are you trying to get? I use DATEADD function for most basic scenarios, not sure if that's what you're looking for here?
Previous Day Sales = CALCULATE(SUM(AssaySales[Extended Sales PMAR Amount]),
DATEADD('DimDate'[Date],-1, DAY)
)
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@Anonymous - when troubleshooting DAX errors, look for where the red squiggly underline begins - you're missing a close bracket near that point after the SUM function, see in bold red below:
Previous Day Sales = CALCULATE(SUM(AssaySales[Extended Sales PMAR Amount] ), PREVIOUSDAY('AssaySales'[Ship Date (MM/DD/YYYY)] ) )
Also, very IMPORTANT, you need a DimDate table for the PreviousDay function to work properly: https://excelwithallison.blogspot.com/2020/04/dimdate-what-why-and-how.html
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
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 |
---|---|
114 | |
99 | |
82 | |
70 | |
61 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |