Forum Discussion
Query (2, 1) Failed to resolve name 'AG'. It is not a valid table, variable, or function name.
Getting the error "Query (2, 1) Failed to resolve name 'AG'. It is not a valid table, variable, or function name" with below query, please help Thanks!
| UG1 | GROUP_TYPE | AG | ITEM_TYPE | LOGIN | NAME | TYPE |
| A-1 | UG | AM | AG | 1234 | Ana | 1 |
| A-1 | UG | AM1 | AG | 12345 | Ben | 1 |
| A-2 | UG | AMF | AG | 123456 | Dan | 1 |
Databel table after aggregation:
UG AG
A-1 AM;AM1
A-2 AMF
Hi Anonymous,
After thoroughly reviewing the details you provided, I was able to reproduce the scenario, and it worked on my end. I have used it as sample data on my end and successfully implemented it.Dax Measure:
AG_Concat_Duplicates =CONCATENATEX(
FILTER(AGTable, AGTable[UG] = MAX(AGTable[UG])),
AGTable[AG],
";"
)
I am also including .pbix file for your better understanding, please have a look into it:
If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.
Thank you for using Microsoft Community Forum.
9 Replies
- v-kpoloju-msftCommunity Support
Hi Anonymous,
Thank you for reaching out to the Microsoft fabric community forum. Thank you Deku, bhanu_gautam, for your inputs on this issue.
After thoroughly reviewing the details you provided, I was able to reproduce the scenario, and it worked on my end. I have used it as sample data on my end and successfully implemented it.Dax Measure for UAM Aggregated:
UAM_Aggregated =ADDCOLUMNS(
SUMMARIZE('UAM', 'UAM'[UG1]),
"AG_Combined", CONCATENATEX(
FILTER('UAM', 'UAM'[UG1] = EARLIER('UAM'[UG1])),
'UAM'[AG],
";"
)
)
I am also including .pbix file for your better understanding, please have a look into it:
If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.
Thank you for using Microsoft Community Forum.- AnonymousNot applicable
Thank you for the help , I am trying to get DISTINCT AG after CONCETENATE as right now the output will be as below: Tried to add in the DISTINCT function before FILTER but no luck, any clue? thanks
UG AG
A-1 AM;AM;AM1
A-2 AMF;AMF- v-kpoloju-msftCommunity Support
Hi Anonymous,
After thoroughly reviewing the details you provided, I was able to reproduce the scenario, and it worked on my end. I have used it as sample data on my end and successfully implemented it.Dax Measure:
AG_Concat_Duplicates =CONCATENATEX(
FILTER(AGTable, AGTable[UG] = MAX(AGTable[UG])),
AGTable[AG],
";"
)
I am also including .pbix file for your better understanding, please have a look into it:
If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.
Thank you for using Microsoft Community Forum.
- bhanu_gautamSuper User
Anonymous , Use
dax
AG =
CONCATENATEX(
FILTER(
'UAM',
'UAM'[AG] = MAXX(ALL('UAM'), 'UAM'[AG])
),
'UAM'[UG1],
";"
)- AnonymousNot applicable
Thanks!
Getting the below:
Query (2, 1) The syntax for 'AG' is incorrect. (dax
AG =
CONCATENATEX(
FILTER(
'UAM',
'UAM'[AG] = MAXX(ALL('UAM'), 'UAM'[AG])
),
'UAM'[UG1],
";"
)).
- DekuSuper User
When using EVALUATE the output needs to be a table
You could something like
Evaluate
Define AG =CONCATENATEX(
FILTER(
'UAM',
'UAM'[AG] = MAX('UAM'[AG])
),
'UAM'[UG1],
";"
)
{Ag}