Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Need to hide Web URL icon In Total value in Table visual when one record is filtered in table

Hi everyone,

I'm facing an issue where I need to hide the URL icon in the totals row of a table visual. The URL icon correctly hides when there are multiple records, but it still appears when there is only one filtered record.

I've used the following DAX measure for the URL:

Links =
VAR AUrl = SELECTEDVALUE(storedetail[AUrl])
RETURN
IF(
ISBLANK(AUrl) || AUrl = "",
BLANK(),
VAR URLs = AUrl &
"?netSales[0]=" & [netsales] &
"&netSales[1]=" & [Loyalty] &
"&netSales[2]=" & [Discount] &
"&storeId[0]=" & SELECTEDVALUE(stores[externalStoreID]) &
"&plazaName[0]=" & SELECTEDVALUE(stores[name]) &
"&email=" & SELECTEDVALUE(storedetail[StoreEmail]) &
"&businessEntity=" & SELECTEDVALUE(storedetail[EntityName])
RETURN
IF(
HASONEVALUE(stores[externalStoreID]) && COUNTROWS(VALUES(stores[externalStoreID])) > 1,
URLs,
BLANK()
)
)


Below is the screen shot for reference


 

 





  • Hi Anonymous 

    You can try using ISINSCOPE instead of HASONEVALUE to control when the URL icon appears. ISINSCOPE ensures that the calculation behaves correctly at different levels of granularity in your table visual.

    Here’s the modified DAX formula:

    DAX
    Links =
    VAR AUrl = SELECTEDVALUE(storedetail[AUrl])
    RETURN
    IF(
    ISBLANK(AUrl) || AUrl = "",
    BLANK(),
    VAR URLs = AUrl &
    "?netSales[0]=" & [netsales] &
    "&netSales[1]=" & [Loyalty] &
    "&netSales[2]=" & [Discount] &
    "&storeId[0]=" & SELECTEDVALUE(stores[externalStoreID]) &
    "&plazaName[0]=" & SELECTEDVALUE(stores[name]) &
    "&email=" & SELECTEDVALUE(storedetail[StoreEmail]) &
    "&businessEntity=" & SELECTEDVALUE(storedetail[EntityName])
    RETURN
    IF(
    ISINSCOPE(stores[externalStoreID]),
    URLs,
    BLANK()
    )
    )

    This modification ensures that the URL is displayed only at the row level (when a store ID is in scope) and is hidden in the total row.
    More information about isinscope here:

    https://www.youtube.com/watch?v=DtOfcsS_pQw

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

1 Reply

  • Hi Anonymous 

    You can try using ISINSCOPE instead of HASONEVALUE to control when the URL icon appears. ISINSCOPE ensures that the calculation behaves correctly at different levels of granularity in your table visual.

    Here’s the modified DAX formula:

    DAX
    Links =
    VAR AUrl = SELECTEDVALUE(storedetail[AUrl])
    RETURN
    IF(
    ISBLANK(AUrl) || AUrl = "",
    BLANK(),
    VAR URLs = AUrl &
    "?netSales[0]=" & [netsales] &
    "&netSales[1]=" & [Loyalty] &
    "&netSales[2]=" & [Discount] &
    "&storeId[0]=" & SELECTEDVALUE(stores[externalStoreID]) &
    "&plazaName[0]=" & SELECTEDVALUE(stores[name]) &
    "&email=" & SELECTEDVALUE(storedetail[StoreEmail]) &
    "&businessEntity=" & SELECTEDVALUE(storedetail[EntityName])
    RETURN
    IF(
    ISINSCOPE(stores[externalStoreID]),
    URLs,
    BLANK()
    )
    )

    This modification ensures that the URL is displayed only at the row level (when a store ID is in scope) and is hidden in the total row.
    More information about isinscope here:

    https://www.youtube.com/watch?v=DtOfcsS_pQw

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.