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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
pacifist
Helper II
Helper II

DAX: How to concatenate strings in CALCULATE and persist the filters

Hi,


I know I can concatenate values in PowerQuery, but out of curiosity, I wanted to do in the DAX on the runtime. Seems like I'm unable to do it effectively along with constantly losing the context.

table: DSN_USERS_VW

 DSN_ID USER_GROUP  IDENTIFIER  PRINCIPAL_TYPE
1 APP-PBI-DSN-GROUP_A  id-of-the group group
1marcello.piatti@...com user
1anna.marina@...com user



I'm trying to build a link to the portal.azure.com to which see the members of the group if the PRINCIPAL_TYPE is group, if it's user, return blank.

 

 

 

_render_asLink = CALCULATE(
  IF(
    MAX(DSN_USERS_VW[PRINCIPAL_TYPE]) = "Group", CONCATENATE("htt..portal.azure.com/../groupId/", MAX(DSN_USERS_VW[IDENTIFIER])), BLANK()
    ), 
  KEEPFILTERS(DSN_USERS_VW)
)

 

 

 


I seriously don't like having to use the aggregation but seem like I have it. Is this the best way to do it? 

When I say it ignores the context, I have another table DSN_VW and the table visual using the data. normally, if I don't have the _render_asLink measunre in the other visual, the DSN_VW filters DSN_USERS_VW nicely, however, with the measure in the latter it always returns all of them. I think I might be having the context wrong there...

Thanks for all your help!

1 REPLY 1
Rupak_bi
Solution Sage
Solution Sage

try this:

_render_asLink = CALCULATE(
  IF(
    MAX(DSN_USERS_VW[PRINCIPAL_TYPE]) = "Group", "htt..portal.azure.com/../groupId/"& MAX(DSN_USERS_VW[IDENTIFIER]), BLANK()
    ), 
  KEEPFILTERS(DSN_USERS_VW)
)


Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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