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.
In the below DAX code getting the following error :
The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.
All =
Var N1 = convert(SELECTEDVALUE('slicer1'[datetime1]), DATETIME)
var Result = SUMMARIZECOLUMNS( table1[code1], table1[text1], "All",
CALCULATE( COUNTROWS(table2), FILTER( table2, table2[datetime2] <= N1
&& (ISBLANK(table2[col1]) || table2[col1] > N1)
&& (ISBLANK(table2[col2]) || table2[col2] > N1)
&& table2[code2] = RELATED(table1[code1] ) ) ) )
return Result
There is no relation between two tables.
The desire result which I want to get is a table with three columns: code1, text1, All
Any idea what should I change in DAX code for this error?
As it says - SUMMARIZECOLUMNS creates a table. Your return statement needs a scalar value.
return SUMX(Result,[All])
would be one option.
Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.
If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...