Forum Discussion
Basic DAX Issue
- 6 months ago
You’re writing measure definitions in DAX Query View and pressing Run. But DAX Query View does not accept measure definitions.
Example 1: simple calculation
EVALUATE ROW ( "Result", 2 + 3 )Example 2: test your aggregation
EVALUATE SUMMARIZE ( 'Table 1', "Total AQuality", SUM ( 'Table 1'[AQuality] ) )Now press Run → results will appear.
DAX Query View runs queries (EVALUATE …), not measure definitions. Create measures in the measure editor, or wrap logic in EVALUATE when using Query View.
Hi, You’re not missing anything obvious this is just how DAX Query View works, and it’s a bit confusing at first. The key thing is that DAX Query View does NOT run measures. It only runs DAX queries. So when you write something like: Test_Measure = SUM ( 'Table 1'[AQuality] ) or even: 2 + 3 it will always fail there, even though those are perfectly valid DAX expressions. In DAX Query View, everything has to be a query, and queries must start with EVALUATE. For example, this will work: EVALUATE ROW ( "Result", 2 + 3 ) Or for your column sum: EVALUATE ROW ( "Total AQuality", SUM ( 'Table 1'[AQuality] ) ) You should see the result in the Results pane after running it. If your goal is just to create a measure, you don’t need DAX Query View at all. Just go to New measure in Report or Model view and paste: Test_Measure = SUM ( 'Table 1'[AQuality] ) Think of DAX Query View more like running a SQL SELECT statement it’s for testing queries, not defining measures. This trips up a lot of people at first, so you’re definitely not alone
This is a great way to explain! Thanks!