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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
rivthebest
Frequent Visitor

Fetching the list of data of a text column based on the filter criteria on another text column

I am looking out for some help in DAX.

Data: https://www.icmagroup.org/membership/List-of-principal-delegates-2/

 

All the columns are Text columns and they are namely: Company, First Name, Last Name, Member Jurisdiction.

Concatenated First Name and Last Name as Full Name and dropped the columns First Name and Last Name using Power Query Interface.

The final dataset contains: Company, Member Jurisdiction, Full Name. All are text columns. Total 634 rows.

 

The following DAX I had written in this way:

Count of Member Banks Per Jurisdicton =
CALCULATE(
    COUNT( ICMA_Members[Company] ),
    GROUPBY( ICMA_Members, ICMA_Members[Member Jurisdiction] )
)
rivthebest_0-1663698041302.png

 

Count of Member Banks Per Jurisdiction and Type =
CALCULATE(
    COUNT( ICMA_Members[Company] ),
    GROUPBY( ICMA_Members, ICMA_Members[Member Jurisdiction] ),
    FILTER( ICMA_Members, RIGHT( ICMA_Members[Company], 3) = "LLP" )
)
rivthebest_1-1663698116166.png

and finally the following DAX:

List of Member Banks Per Jurisdiction and Type =
CALCULATETABLE(
    VALUES( ICMA_Members[Company] ),
    GROUPBY( ICMA_Members, ICMA_Members[Member Jurisdiction] ),
    FILTER( ICMA_Members, RIGHT( ICMA_Members[Company], 3) = "LLP" )
)
 
This is the query I am having problem. Instead of count of Member Banks per Jurisdiction per the filter condition I had set, I would like to fetch the list of the Member Banks per Jurisdiction and Filter Condition set. The above DAX formula is syntactically correct but it is not helping me to yield any result as it cannot be used in the Value segment in the Matrix Visual. Here is the error message posted below.
 
rivthebest_2-1663698363748.png

 

I am quite certain I am making a terrible unpardonable silly mistake and that is why I am seeking your valuable advise. Please help me out.

1 ACCEPTED SOLUTION

Hi Xiaoxin,

 

Thank you for your help.. you are a life saviour. A minor change I had to do in your code segment. Instead of using CALCULATETABLE, CALCULATE will be in place and final piece of code is as follows:

 

List of Member Banks Per Jurisdiction and Type =
CALCULATE(
    CONCATENATEX(VALUES( ICMA_Members[Company] ), ICMA_Members[Company], ",")
    GROUPBY( ICMA_Members, ICMA_Members[Member Jurisdiction] ),
    FILTER( ICMA_Members, RIGHT( ICMA_Members[Company], 3) = "LLP" )
)

View solution in original post

8 REPLIES 8
rivthebest
Frequent Visitor

I got the idea... it should be CALCULATE instead of CALCULATETABLE.... thank you...

rivthebest
Frequent Visitor

Hi Xiaoxin,

 

By Following your step I am getting the following error pasted as screenshot:

 

rivthebest_0-1663731819103.png

 

Please advise.

 

Regards

Riv

Ashish_Mathur
Super User
Super User

Hi,

Could you share some data to work with and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish,

 

Data: https://www.icmagroup.org/membership/List-of-principal-delegates-2/

 

All the columns are Text columns and they are namely: Company, First Name, Last Name, Member Jurisdiction.

Concatenated First Name and Last Name as Full Name and dropped the columns First Name and Last Name using Power Query Interface.

The final dataset contains: Company, Member Jurisdiction, Full Name. All are text columns. Total 634 rows.

 

The following DAX I had written in this way:

Count of Member Banks Per Jurisdicton =
CALCULATE(
    COUNT( ICMA_Members[Company] ),
    GROUPBY( ICMA_Members, ICMA_Members[Member Jurisdiction] )
)
Count of Member Banks Per Jurisdiction and Type =
CALCULATE(
    COUNT( ICMA_Members[Company] ),
    GROUPBY( ICMA_Members, ICMA_Members[Member Jurisdiction] ),
    FILTER( ICMA_Members, RIGHT( ICMA_Members[Company], 3) = "LLP" )
)
 
and Lastly what Xiaoxin has mentioned in his code and I had applied the same with a minor alteration like instead of using CALCULATETABLE I had used CALCULATE and it worked. 
 
List of Member Banks Per Jurisdiction and Type =
CALCULATE(
    VALUES( ICMA_Members[Company] ),
    GROUPBY( ICMA_Members, ICMA_Members[Member Jurisdiction] ),
    FILTER( ICMA_Members, RIGHT( ICMA_Members[Company], 3) = "LLP" )
)
 
Ahish please let me know if any other details I need to furnish
 
Regards Riv

Hi Ashish,

 

Please disregard my last message

 

Here is the updated one:

 

Data: https://www.icmagroup.org/membership/List-of-principal-delegates-2/

 

All the columns are Text columns and they are namely: Company, First Name, Last Name, Member Jurisdiction.

Concatenated First Name and Last Name as Full Name and dropped the columns First Name and Last Name using Power Query Interface.

The final dataset contains: Company, Member Jurisdiction, Full Name. All are text columns. Total 634 rows.

 

The following DAX I had written in this way:

Count of Member Banks Per Jurisdicton =
CALCULATE(
    COUNT( ICMA_Members[Company] ),
    GROUPBY( ICMA_Members, ICMA_Members[Member Jurisdiction] )
)
Count of Member Banks Per Jurisdiction and Type =
CALCULATE(
    COUNT( ICMA_Members[Company] ),
    GROUPBY( ICMA_Members, ICMA_Members[Member Jurisdiction] ),
    FILTER( ICMA_Members, RIGHT( ICMA_Members[Company], 3) = "LLP" )
)
 
and Lastly what Xiaoxin has mentioned in his code and I had applied the same with a minor alteration like instead of using CALCULATETABLE I had used CALCULATE and it worked. 
 
List of Member Banks Per Jurisdiction and Type =
CALCULATE(
    CONCATENATEX(VALUES( ICMA_Members[Company] ), ICMA_Members[Company], ",")
    GROUPBY( ICMA_Members, ICMA_Members[Member Jurisdiction] ),
    FILTER( ICMA_Members, RIGHT( ICMA_Members[Company], 3) = "LLP" )
)
 
Ashish please let me know if any other details I need to furnish
 
Regards Riv

Hi,

Your said that Xiaoxin's formula worked so i assume your question is answered.  If not, then (as requested in my message earlier), share soem data and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @rivthebest,

AFAIK, VALUES function will return a list if the current row context has multiple rows. (the returned data type is not supported to use in measure)
I think you need to do concatenate operations with the result to handle if the current row context has been aggregated with multiple rows:

List of Member Banks Per Jurisdiction and Type =
CALCULATETABLE (
    CONCATENATEX ( VALUES ( ICMA_Members[Company] ), [Company], "," ),
    GROUPBY ( ICMA_Members, ICMA_Members[Member Jurisdiction] ),
    FILTER ( ICMA_Members, RIGHT ( ICMA_Members[Company], 3 ) = "LLP" )
)

Regards,

Xiaoxin Sheng

Hi Xiaoxin,

 

Thank you for your help.. you are a life saviour. A minor change I had to do in your code segment. Instead of using CALCULATETABLE, CALCULATE will be in place and final piece of code is as follows:

 

List of Member Banks Per Jurisdiction and Type =
CALCULATE(
    CONCATENATEX(VALUES( ICMA_Members[Company] ), ICMA_Members[Company], ",")
    GROUPBY( ICMA_Members, ICMA_Members[Member Jurisdiction] ),
    FILTER( ICMA_Members, RIGHT( ICMA_Members[Company], 3) = "LLP" )
)

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.