The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 |
1 | marcello.piatti@...com | user | |
1 | anna.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!
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)
)
User | Count |
---|---|
26 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
32 | |
14 | |
11 | |
10 | |
9 |