Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Cacao90
Frequent Visitor

Tables with no relationship

 

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?

1 REPLY 1
lbendlin
Super User
Super User

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...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors