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
maximilius
New Member

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! 

EVALUATE
AG =CONCATENATEX(  
        FILTER(
            'UAM',
            'UAM'[AG] = MAX('UAM'[AG])
        ),
        'UAM'[UG1],
        ";"
    )
 
 
Data table example before aggregation: 
UG1GROUP_TYPEAGITEM_TYPELOGINNAMETYPE
A-1UGAMAG1234Ana1
A-1UGAM1AG12345Ben1
A-2UGAMFAG123456Dan1

 

Databel table after aggregation:
UG   AG              
A-1   AM;AM1       
A-2   AMF

1 ACCEPTED SOLUTION

Hi @maximilius,

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],

    ";"

)

vkpolojumsft_1-1744344602872.png

 

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.

View solution in original post

9 REPLIES 9
v-kpoloju-msft
Community Support
Community Support

Hi @maximilius,
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],

        ";"

    )

)

vkpolojumsft_5-1744280923109.png


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.

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

Hi @maximilius,

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],

    ";"

)

vkpolojumsft_1-1744344602872.png

 

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.

Hi @maximilius,

 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

 

Thank you.

Hi @maximilius,


I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.


Thank you.

Hi @maximilius,


I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.


Thank you.

Deku
Super User
Super 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}


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
bhanu_gautam
Super User
Super User

@maximilius , Use 

 

dax
AG =
CONCATENATEX(
FILTER(
'UAM',
'UAM'[AG] = MAXX(ALL('UAM'), 'UAM'[AG])
),
'UAM'[UG1],
";"
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






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],
";"
)).

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.