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
abhiram342
Microsoft Employee
Microsoft Employee

Dynamically change measure/column based on toggle button or slicer

Hi Team - I created a Direct Lake model based on the Lakehouse SQL endpoint, and one of the tables contains two URL columns. We need to display the URL column in a table chart, dynamically showing either URL1 or URL2 based on the tenant name.

If a user opens the report in Tenant "A," it should display URL1.
If a user opens the report in Tenant "B," it should display URL2.
By default, the URL should be URL1.
I researched possible solutions and found the following approaches:

Tenant Selection Table – Create a table in Direct Lake with tenant names (Tenant A & Tenant B) and use a measure to switch between URL1 and URL2 based on the selected tenant in a slicer.
Toggle Button – Use a toggle button to switch between Tenant A & Tenant B, defaulting to URL1 unless another option is selected.
Is there a way to achieve this behavior without creating a table in Direct Lake? I noticed that calculated tables are not supported in Direct Lake.
 
Thanks,
Abhiram
1 ACCEPTED SOLUTION
BeaBF
Super User
Super User

@abhiram342 Hi! Yes, you can achieve this behavior without creating a separate table in Direct Lake by leveraging DAX measures and dynamic filtering. 

Create a measure in Power BI that dynamically switches URLs based on the user's tenant:
SelectedURL =
VAR CurrentTenant = LOOKUPVALUE(TenantTable[TenantName], TenantTable[UserEmail], USERPRINCIPALNAME())
RETURN
IF(CurrentTenant = "Tenant B", SELECTEDVALUE(Table[URL2]), SELECTEDVALUE(Table[URL1]))

 

Use the measure in your table visual.

 

BBF

View solution in original post

4 REPLIES 4
v-veshwara-msft
Community Support
Community Support

HI @abhiram342 ,

Following up to see if your query has been resolved. If any of the responses helped, please consider marking the relevant reply as the 'Accepted Solution' to assist others with similar questions.

If you're still facing issues, feel free to reach out.

Thank you.

v-veshwara-msft
Community Support
Community Support

Hi @abhiram342 ,

Just checking in again as we haven’t heard back from you. If the provided solutions addressed your issue, kindly mark the helpful reply as the Accepted Solution to assist others with similar queries.

If your issue is still unresolved or you need further help, feel free to reach out.
Thank you.

v-veshwara-msft
Community Support
Community Support

Hi @abhiram342 ,
Thanks for using Microsoft Fabric Community,
Just wanted to check if the solution provided by @BeaBF  has met your needs. If yes, Please consider marking it as "Accepted Solution" to assist others with similar queries. If further assistance is needed, please reach out.
Thank you.

BeaBF
Super User
Super User

@abhiram342 Hi! Yes, you can achieve this behavior without creating a separate table in Direct Lake by leveraging DAX measures and dynamic filtering. 

Create a measure in Power BI that dynamically switches URLs based on the user's tenant:
SelectedURL =
VAR CurrentTenant = LOOKUPVALUE(TenantTable[TenantName], TenantTable[UserEmail], USERPRINCIPALNAME())
RETURN
IF(CurrentTenant = "Tenant B", SELECTEDVALUE(Table[URL2]), SELECTEDVALUE(Table[URL1]))

 

Use the measure in your table visual.

 

BBF

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.