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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
SunnyWu
New Member

SUMMARIZE base on 2 tables, in error "he column 'SYSCred' specified in the 'SUMMARIZE' function was

hi expert,

 

i am new to power BI, and when I try to use summarize function with 2 tables with following syntax, 

var t_op = SUMMARIZE(
MergeALLSQL,
MergeALLSQL[name1],
MergeALLSQL[re_FORM_OP1],
MergeALLSQL[Account],
JDT1op[SYSCred]
)

it shows the error "the column 'SYSCred' specified in the 'SUMMARIZE' function was not found in the input table."

 

tables are in many with many relationships, and mapping with the account number, 

SunnyWu_0-1672329307759.png

SunnyWu_1-1672329352523.png

any idea?

 

Sunny Wu

 

1 ACCEPTED SOLUTION

@SunnyWu 

Yes you are right. It was my mistake. Please try

var t_op =
GENERATE (
SUMMARIZE (
MergeALLSQL,
MergeALLSQL[name1],
MergeALLSQL[re_FORM_OP1],
MergeALLSQL[Account]
),
SELECTCOLUMNS ( RELATEDTABLE ( JDT1op ), "@SYSCred", JDT1op[SYSCred] )
)

View solution in original post

8 REPLIES 8
tamerj1
Super User
Super User

Hi @SunnyWu 

please try

var t_op =
GENERATE (
SUMMARIZE (
MergeALLSQL,
MergeALLSQL[name1],
MergeALLSQL[re_FORM_OP1],
MergeALLSQL[Account]
),
RELATEDTABLE ( VALUES ( JDT1op[SYSCred] ) )
)

Hi @tamerj1 ,

Thanks you first, but it shows an error The RELATEDTABLE function expects a table reference for argument '1', but a table expression was used.

SunnyWu_0-1672331441355.png

sunny

@SunnyWu 

Yes you are right. It was my mistake. Please try

var t_op =
GENERATE (
SUMMARIZE (
MergeALLSQL,
MergeALLSQL[name1],
MergeALLSQL[re_FORM_OP1],
MergeALLSQL[Account]
),
SELECTCOLUMNS ( RELATEDTABLE ( JDT1op ), "@SYSCred", JDT1op[SYSCred] )
)

Thx, it is working, and it is inner join, many thanks!

@SunnyWu 

 

Try the following that creates a new table:

Table = 
var combinetable = ADDCOLUMNS('MergeALLSQL',"SYS Cred",RELATED('JDT1op'[SYSCred]))
return 
SUMMARIZE(combinetable,[SYS Cred],'MergeALLSQL'[name1],'MergeALLSQL'[re_FORM_OP1],'MergeALLSQL'[Account])

 

still not working

SunnyWu_0-1672332800335.png

 

or i cannot use related() in many-to-many relationships?

https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-many-to-many-relationships

@SunnyWu 

 

make sure that the fieldname is written correcty in the formula and in the relationship between the two tables select 'Both' on 'Cross Filter Direction'

hi @themistoklis i counter check all the field names

SunnyWu_1-1672334865826.png

and 

the relationship is 'Both' on 'Cross Filter Direction'

SunnyWu_3-1672334987955.png

 

 

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.