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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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