The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I watched Marco's video but still don't get this.
I tried switching this to a SUMX and still got the same result.
I thought the row context was being established by the calculaed column and aggregator? What am I missing here.
Solved! Go to Solution.
When you are calculating a single row, the context is that single row. Thus if you do a "SUM" on a column of the current table, you will only be summing up 1 rows worth of values.
Instead you might want to use a calculate statement and provide a filter context. For example, this would give you a sum total of all of the prices where each row has the same location value. (I have no idea why you would do that, but i hope it illustrates the point).
Column = VAR LocationValue = [Location] RETURN CALCULATE( SUM ( Order[Price] ), ALL ( Order ), Order[Location] = LocationValue )
When you are calculating a single row, the context is that single row. Thus if you do a "SUM" on a column of the current table, you will only be summing up 1 rows worth of values.
Instead you might want to use a calculate statement and provide a filter context. For example, this would give you a sum total of all of the prices where each row has the same location value. (I have no idea why you would do that, but i hope it illustrates the point).
Column = VAR LocationValue = [Location] RETURN CALCULATE( SUM ( Order[Price] ), ALL ( Order ), Order[Location] = LocationValue )