The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
In my Don't Use CALCULATE! video, I demonstrated the many downsides to DAX's CALCULATE function. Namely, it is confusing and difficult to use for those new to DAX, it doesn't work very well in single table data models, is difficult to debug and; generally, is pretty much unnecessary in the vast majority of situations.
But! How then do you implement an ALLEXCEPT without using CALCULATE you may ask? Well, here you go. ALLEXCEPT Without CALCULATE. It's actually super simple.
Allexcept without ALLEXCEPT =
VAR __Months = DISTINCT('Table'[Month])
VAR __Table = ALL('Table')
VAR __Table1 = FILTER(__Table,[Month] IN __Months)
RETURN
IF(
ISFILTERED('Table'[Month]),
SUMX(__Table1,[Value]),
SUMX(__Table,[Value])
)
eyJrIjoiMmE0ODk2ZDEtMmQwYy00MDQyLWI2OWQtYzVhNjE0NmI0ZmI5IiwidCI6IjRhMDQyNzQzLTM3M2EtNDNkMi04MjdiLTAwM2Y0YzdiYTFlNSIsImMiOjN9